.frac now number instead of int_64_t on x64

This commit is contained in:
Cosmin Apreutesei 2014-11-09 21:29:31 +02:00
parent 76c4901733
commit ac163f8b9c
2 changed files with 6 additions and 6 deletions

View File

@ -67,7 +67,7 @@ function M.client_info()
end end
function M.client_version() function M.client_version()
return tonumber(C.mysql_get_client_version) return tonumber(C.mysql_get_client_version())
end end
--connections --connections
@ -1102,7 +1102,7 @@ function fields:get_date(i)
time and tm.hour or nil, time and tm.hour or nil,
time and tm.minute or nil, time and tm.minute or nil,
time and tm.second or nil, time and tm.second or nil,
time and tm.second_part or nil time and tonumber(tm.second_part) or nil
end end
function params:set_date(i, year, month, day, hour, min, sec, frac) function params:set_date(i, year, month, day, hour, min, sec, frac)
@ -1159,12 +1159,12 @@ function fields:get(i)
elseif time_types[btype] then elseif time_types[btype] then
local t = self.data[i] local t = self.data[i]
if t.time_type == C.MYSQL_TIMESTAMP_TIME then if t.time_type == C.MYSQL_TIMESTAMP_TIME then
return datetime{hour = t.hour, min = t.minute, sec = t.second, frac = t.second_part} return datetime{hour = t.hour, min = t.minute, sec = t.second, frac = tonumber(t.second_part)}
elseif t.time_type == C.MYSQL_TIMESTAMP_DATE then elseif t.time_type == C.MYSQL_TIMESTAMP_DATE then
return datetime{year = t.year, month = t.month, day = t.day} return datetime{year = t.year, month = t.month, day = t.day}
elseif t.time_type == C.MYSQL_TIMESTAMP_DATETIME then elseif t.time_type == C.MYSQL_TIMESTAMP_DATETIME then
return datetime{year = t.year, month = t.month, day = t.day, return datetime{year = t.year, month = t.month, day = t.day,
hour = t.hour, min = t.minute, sec = t.second, frac = t.second_part} hour = t.hour, min = t.minute, sec = t.second, frac = tonumber(t.second_part)}
else else
error'invalid time' error'invalid time'
end end

View File

@ -535,6 +535,6 @@ Instruct the server to dump debug info in the log file. `SUPER` priviledge neede
## TODO ## TODO
* reader function for getting large blobs in chunks using mysql_stmt_fetch_column: `stmt:chunks(i[, bufsize])` or `stmt:read()` ? * reader function for getting large blobs in chunks using
* test with Linux, OSX, 64bit OSs mysql_stmt_fetch_column: `stmt:chunks(i[, bufsize])` or `stmt:read()` ?
* support connecting against different runtimes (client_library option) * support connecting against different runtimes (client_library option)