summaryrefslogtreecommitdiff
path: root/src
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
commit674e428ef6f0edbcc89944cd76d697dd2546e393 (patch)
treec742c07e6ddd4460130105032c7f15e4c5b4c27f /src
parent744aa8a2e9d3812c6600e919efd6a983d1d11335 (diff)
Fix MySQL time handling
Diffstat (limited to 'src')
-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,