summaryrefslogtreecommitdiff
path: root/src/mysql.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-13 15:33:11 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-13 15:33:11 -0400
commit3b49e9b8e45e1caf7a14700b553f8ca1fb62e44e (patch)
treebe89f348c01d092ad1a0f7cbbb80b574a3f20a6c /src/mysql.sml
parent3e58952b52b3a731a8e78b11b47f0e8d6e647d14 (diff)
Fix some MySQL bugs
Diffstat (limited to 'src/mysql.sml')
-rw-r--r--src/mysql.sml10
1 files changed, 7 insertions, 3 deletions
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",