summaryrefslogtreecommitdiff
path: root/src/mysql.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-03-27 15:06:02 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-03-27 15:06:02 -0400
commit490acedef648f89dd9aa5a8b5462aff880d8d94b (patch)
treec742c07e6ddd4460130105032c7f15e4c5b4c27f /src/mysql.sml
parent1bb5bf1342b794a7918678922e7cef2ab388160a (diff)
Fix MySQL time handling
Diffstat (limited to 'src/mysql.sml')
-rw-r--r--src/mysql.sml8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mysql.sml b/src/mysql.sml
index 2f28f4dd..6077eb5c 100644
--- a/src/mysql.sml
+++ b/src/mysql.sml
@@ -675,7 +675,9 @@ fun p_getcol {loc, wontLeakStrings = _, col = i, typ = t} =
newline,
string "struct tm t = {mt->second, mt->minute, mt->hour, mt->day, mt->month-1, mt->year - 1900, 0, 0, -1};",
newline,
- string "mktime(&t);",
+ string "uw_Basis_time res = {mktime(&t), 0};",
+ newline,
+ string "res;",
newline,
string "})"]
| Channel => box [string "({",
@@ -1082,7 +1084,7 @@ fun queryPrepared {loc, id, query, inputs, cols, doCols, nested} =
newline,
string "if (localtime_r(&arg",
string (Int.toString (i + 1)),
- string ", &tms) == NULL) uw_error(ctx, FATAL, \"",
+ string ".seconds, &tms) == NULL) uw_error(ctx, FATAL, \"",
string (ErrorMsg.spanToString loc),
string ": error converting to MySQL time\");",
newline,
@@ -1366,7 +1368,7 @@ fun dmlPrepared {loc, id, dml, inputs, mode} =
newline,
string "if (localtime_r(&arg",
string (Int.toString (i + 1)),
- string ", &tms) == NULL) uw_error(ctx, FATAL, \"",
+ string ".seconds, &tms) == NULL) uw_error(ctx, FATAL, \"",
string (ErrorMsg.spanToString loc),
string ": error converting to MySQL time\");",
newline,