changeset 933:6a284a3519ba

Fix some MySQL bugs
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Sep 2009 15:33:11 -0400
parents 0a156bbd205f
children 36f787c02287
files src/mysql.sml
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/mysql.sml	Sun Sep 13 13:25:09 2009 -0400
+++ b/src/mysql.sml	Sun Sep 13 15:33:11 2009 -0400
@@ -1054,7 +1054,7 @@
                                                                newline,
                                                                string "if (localtime_r(&arg",
                                                                string (Int.toString (i + 1)),
-                                                               string ", &tm) == NULL) uw_error(\"",
+                                                               string ", &tms) == NULL) uw_error(ctx, FATAL, \"",
                                                                string (ErrorMsg.spanToString loc),
                                                                string ": error converting to MySQL time\");",
                                                                newline,
@@ -1073,6 +1073,8 @@
                                                                string "].buffer = &in_buffer",
                                                                string (Int.toString i),
                                                                string ";",
+                                                               newline,
+                                                               string "});",
                                                                newline]
                                                       end
                                                     | Channel => box [string "in_buffer",
@@ -1178,7 +1180,7 @@
          newline,
          string "MYSQL_stmt *stmt = mysql_stmt_init(conn->conn);",
          newline,
-         string "if (stmt == NULL) uw_error(ctx, \"",
+         string "if (stmt == NULL) uw_error(ctx, FATAL, \"",
          string (ErrorMsg.spanToString loc),
          string ": can't allocate temporary prepared statement\");",
          newline,
@@ -1333,7 +1335,7 @@
                                                                newline,
                                                                string "if (localtime_r(&arg",
                                                                string (Int.toString (i + 1)),
-                                                               string ", &tm) == NULL) uw_error(\"",
+                                                               string ", &tms) == NULL) uw_error(ctx, FATAL, \"",
                                                                string (ErrorMsg.spanToString loc),
                                                                string ": error converting to MySQL time\");",
                                                                newline,
@@ -1349,6 +1351,8 @@
                                                                string "].buffer = &in_buffer",
                                                                string (Int.toString i),
                                                                string ";",
+                                                               newline,
+                                                               string "});",
                                                                newline]
                                                       end
                                                     | Channel => box [string "in_buffer",