diff options
author | Adam Chlipala <adam@chlipala.net> | 2014-01-07 08:36:18 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2014-01-07 08:36:18 -0500 |
commit | bb567cd6c1490dcabf53a3dd18f1aebd8e3055e0 (patch) | |
tree | cbcfc3515fda056d6e92f322912db3cfd696b282 /src | |
parent | f00f54541df6722f06057da89da38ba906252058 (diff) |
MySQL: Combine transaction setup commands into one mysql_query()
Diffstat (limited to 'src')
-rw-r--r-- | src/mysql.sml | 6 |
1 files changed, 2 insertions, 4 deletions
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, |