mirror of
https://github.com/luapower/mysql.git
synced 2025-01-04 07:10:25 +01:00
unimportant
This commit is contained in:
parent
d573b46a62
commit
c1f8b9ac31
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
local sha1 = require'sha1'.sha1
|
local sha1 = require'sha1'.sha1
|
||||||
local bit = require'bit'
|
local bit = require'bit'
|
||||||
|
local null = require'cjson'.null
|
||||||
|
|
||||||
local sub = string.sub
|
local sub = string.sub
|
||||||
local strbyte = string.byte
|
local strbyte = string.byte
|
||||||
@ -12,7 +13,6 @@ local strchar = string.char
|
|||||||
local strfind = string.find
|
local strfind = string.find
|
||||||
local format = string.format
|
local format = string.format
|
||||||
local strrep = string.rep
|
local strrep = string.rep
|
||||||
local null = function() end
|
|
||||||
local band = bit.band
|
local band = bit.band
|
||||||
local bxor = bit.bxor
|
local bxor = bit.bxor
|
||||||
local bor = bit.bor
|
local bor = bit.bor
|
||||||
@ -97,10 +97,9 @@ local conn = {}
|
|||||||
local mt = {__index = conn}
|
local mt = {__index = conn}
|
||||||
|
|
||||||
-- mysql field value type converters
|
-- mysql field value type converters
|
||||||
local converters = new_tab(0, 9)
|
local converters = {}
|
||||||
|
|
||||||
for i = 0x01, 0x05 do
|
for i = 0x01, 0x05 do -- tiny, short, long, float, double
|
||||||
-- tiny, short, long, float, double
|
|
||||||
converters[i] = tonumber
|
converters[i] = tonumber
|
||||||
end
|
end
|
||||||
converters[0x00] = tonumber -- decimal
|
converters[0x00] = tonumber -- decimal
|
||||||
@ -559,10 +558,10 @@ function conn:connect(opts)
|
|||||||
|
|
||||||
local host = opts.host
|
local host = opts.host
|
||||||
local port = opts.port or 3306
|
local port = opts.port or 3306
|
||||||
ok, err = sock:connect(host, port)
|
ok, err, errcode = sock:connect(host, port)
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
return nil, 'failed to connect: ' .. err
|
return nil, err, errcode
|
||||||
end
|
end
|
||||||
|
|
||||||
local packet, typ, err = _recv_packet(self)
|
local packet, typ, err = _recv_packet(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user