# HG changeset patch # User Adam Chlipala # Date 1389101778 18000 # Node ID 469e02eea43af2419a9e080f6d2daf6fbe8868c2 # Parent 1802eb00a0ae01c5b5f3107d475307d38e5e9151 MySQL: Combine transaction setup commands into one mysql_query() diff -r 1802eb00a0ae -r 469e02eea43a src/mysql.sml --- 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,