From bb567cd6c1490dcabf53a3dd18f1aebd8e3055e0 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 7 Jan 2014 08:36:18 -0500 Subject: MySQL: Combine transaction setup commands into one mysql_query() --- src/mysql.sml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mysql.sml') diff --git a/src/mysql.sml b/src/mysql.sml index 3b59d1c1..472b72d1 100644 --- a/src/mysql.sml +++ b/src/mysql.sml @@ -536,7 +536,7 @@ fun init {dbstring, prepared = ss, tables, views, sequences} = | 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 @@ fun init {dbstring, prepared = ss, tables, views, sequences} = 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, -- cgit v1.2.3