unimportant

This commit is contained in:
Cosmin Apreutesei 2021-10-09 21:28:15 +03:00
parent efb40c05ae
commit 050062b1e6
1 changed files with 14 additions and 0 deletions

View File

@ -958,8 +958,21 @@ end
local get_collation --fw. decl.
function mysql.log(severity, ...)
local logging = mysql.logging
if not logging then return end
logging.log(severity, 'mysql', ...)
end
function mysql.note(...)
mysql.log('note', ...)
end
function mysql.connect(opt)
mysql.note('connect', 'host=%s:%s user=%s schema=%s',
opt.host, opt.port or 3306, opt.user, opt.schema or '')
local tcp = opt and opt.tcp or require'sock'.tcp
local tcp = check_io(self, tcp())
local self = setmetatable({tcp = tcp}, conn_mt)
@ -1061,6 +1074,7 @@ end
conn.close = protect(conn.close)
local function send_query(self, query)
mysql.note('query', '%s', query)
assert(self.state == 'ready')
self.packet_no = -1
local buf = send_buffer(1 + #query)