mirror of
https://github.com/luapower/mysql.git
synced 2025-01-01 14:00:27 +01:00
unimportant
This commit is contained in:
parent
e183de65cd
commit
f68e13c9e6
@ -357,18 +357,15 @@ local function _from_length_coded_bin(data, pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function _from_length_coded_str(data, pos, lower)
|
local function _from_length_coded_str(data, pos)
|
||||||
local len
|
local len
|
||||||
len, pos = _from_length_coded_bin(data, pos)
|
len, pos = _from_length_coded_bin(data, pos)
|
||||||
if not len or len == null then
|
if not len or len == null then
|
||||||
return null, pos
|
return null, pos
|
||||||
end
|
end
|
||||||
local s = sub(data, pos, pos + len - 1)
|
return sub(data, pos, pos + len - 1), pos + len
|
||||||
if lower then s = s:lower() end
|
|
||||||
return s, pos + len
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function _parse_ok_packet(packet)
|
local function _parse_ok_packet(packet)
|
||||||
local res = new_tab(0, 5)
|
local res = new_tab(0, 5)
|
||||||
local pos
|
local pos
|
||||||
@ -441,15 +438,21 @@ local UNIQUE_KEY_FLAG = 4
|
|||||||
local UNSIGNED_FLAG = 32
|
local UNSIGNED_FLAG = 32
|
||||||
local AUTO_INCREMENT_FLAG = 512
|
local AUTO_INCREMENT_FLAG = 512
|
||||||
|
|
||||||
|
local function _parse_field(data, pos)
|
||||||
|
local s, pos = _from_length_coded_str(data, pos)
|
||||||
|
s = s ~= null and s ~= '' and s:lower() or nil
|
||||||
|
return s, pos
|
||||||
|
end
|
||||||
|
|
||||||
local function _parse_field_packet(data)
|
local function _parse_field_packet(data)
|
||||||
local col = new_tab(0, 2)
|
local col = new_tab(0, 2)
|
||||||
local pos
|
local pos
|
||||||
col.catalog, pos = _from_length_coded_str(data, 1, true)
|
col.catalog, pos = _parse_field(data, 1)
|
||||||
col.schema, pos = _from_length_coded_str(data, pos, true)
|
col.schema, pos = _parse_field(data, pos)
|
||||||
col.table, pos = _from_length_coded_str(data, pos, true)
|
col.table, pos = _parse_field(data, pos)
|
||||||
col.orig_table, pos = _from_length_coded_str(data, pos, true)
|
col.orig_table, pos = _parse_field(data, pos)
|
||||||
col.name, pos = _from_length_coded_str(data, pos, true)
|
col.name, pos = _parse_field(data, pos)
|
||||||
col.orig_name, pos = _from_length_coded_str(data, pos, true)
|
col.orig_name, pos = _parse_field(data, pos)
|
||||||
pos = pos + 1 -- ignore the filler
|
pos = pos + 1 -- ignore the filler
|
||||||
col.charsetnr, pos = _get_byte2(data, pos)
|
col.charsetnr, pos = _get_byte2(data, pos)
|
||||||
col.length, pos = _get_byte4(data, pos)
|
col.length, pos = _get_byte4(data, pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user