From 3b49e9b8e45e1caf7a14700b553f8ca1fb62e44e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 13 Sep 2009 15:33:11 -0400 Subject: Fix some MySQL bugs --- src/mysql.sml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mysql.sml') diff --git a/src/mysql.sml b/src/mysql.sml index 32df47d4..25efc641 100644 --- a/src/mysql.sml +++ b/src/mysql.sml @@ -1054,7 +1054,7 @@ fun queryPrepared {loc, id, query, inputs, cols, doCols, nested} = 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 @@ fun queryPrepared {loc, id, query, inputs, cols, doCols, nested} = string "].buffer = &in_buffer", string (Int.toString i), string ";", + newline, + string "});", newline] end | Channel => box [string "in_buffer", @@ -1178,7 +1180,7 @@ fun dml loc = 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 @@ fun dmlPrepared {loc, id, dml, inputs} = 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 @@ fun dmlPrepared {loc, id, dml, inputs} = string "].buffer = &in_buffer", string (Int.toString i), string ";", + newline, + string "});", newline] end | Channel => box [string "in_buffer", -- cgit v1.2.3