From ac163f8b9c2ac37adf995a86b2a23fcb73b1f05b Mon Sep 17 00:00:00 2001 From: Cosmin Apreutesei Date: Sun, 9 Nov 2014 21:29:31 +0200 Subject: [PATCH] .frac now number instead of int_64_t on x64 --- mysql.lua | 8 ++++---- mysql.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql.lua b/mysql.lua index c03e164..875ca5c 100644 --- a/mysql.lua +++ b/mysql.lua @@ -67,7 +67,7 @@ function M.client_info() end function M.client_version() - return tonumber(C.mysql_get_client_version) + return tonumber(C.mysql_get_client_version()) end --connections @@ -1102,7 +1102,7 @@ function fields:get_date(i) time and tm.hour or nil, time and tm.minute or nil, time and tm.second or nil, - time and tm.second_part or nil + time and tonumber(tm.second_part) or nil end 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 local t = self.data[i] 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 return datetime{year = t.year, month = t.month, day = t.day} elseif t.time_type == C.MYSQL_TIMESTAMP_DATETIME then 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 error'invalid time' end diff --git a/mysql.md b/mysql.md index e08d6ba..4f71692 100644 --- a/mysql.md +++ b/mysql.md @@ -535,6 +535,6 @@ Instruct the server to dump debug info in the log file. `SUPER` priviledge neede ## TODO - * reader function for getting large blobs in chunks using mysql_stmt_fetch_column: `stmt:chunks(i[, bufsize])` or `stmt:read()` ? - * test with Linux, OSX, 64bit OSs + * reader function for getting large blobs in chunks using + mysql_stmt_fetch_column: `stmt:chunks(i[, bufsize])` or `stmt:read()` ? * support connecting against different runtimes (client_library option)