changeset 1955:469e02eea43a

MySQL: Combine transaction setup commands into one mysql_query()
author Adam Chlipala <adam@chlipala.net>
date Tue, 07 Jan 2014 08:36:18 -0500
parents 1802eb00a0ae
children ac1be85e91ad
files src/mysql.sml
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/mysql.sml	Sun Jan 05 20:20:09 2014 -0500
+++ b/src/mysql.sml	Tue Jan 07 08:36:18 2014 -0500
@@ -536,7 +536,7 @@
                | SOME n => string (Int.toString n),
              string ", ",
              stringOf unix_socket,
-             string ", 0) == NULL) {",
+             string ", CLIENT_MULTI_STATEMENTS) == NULL) {",
              newline,
              box [string "char msg[1024];",
                   newline,
@@ -589,9 +589,7 @@
              string "uw_conn *conn = uw_get_db(ctx);",
              newline,
              newline,
-             string "return mysql_query(conn->conn, \"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE\")",
-             newline,
-             string "  || mysql_query(conn->conn, \"BEGIN\");",
+             string "return mysql_query(conn->conn, \"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; BEGIN\") ? 1 : (mysql_next_result(conn->conn), 0);",
              newline,
              string "}",
              newline,