diff src/mysql.sml @ 1443:19e8e3d556d6

Fix MySQL time handling
author Adam Chlipala <adam@chlipala.net>
date Sun, 27 Mar 2011 15:06:02 -0400
parents 929981850d9d
children 969b90b1f2f9
line wrap: on
line diff
--- a/src/mysql.sml	Sat Mar 26 13:43:47 2011 -0400
+++ b/src/mysql.sml	Sun Mar 27 15:06:02 2011 -0400
@@ -675,7 +675,9 @@
                              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 @@
                                                                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 @@
                                                                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,