comparison src/mysql.sml @ 1954:1802eb00a0ae

MySQL: catch deadlocks during queries
author Adam Chlipala <adam@chlipala.net>
date Sun, 05 Jan 2014 20:20:09 -0500
parents 0992323fa264
children 469e02eea43a
comparison
equal deleted inserted replaced
1953:0992323fa264 1954:1802eb00a0ae
852 query, 852 query,
853 string ", mysql_error(conn->conn));", 853 string ", mysql_error(conn->conn));",
854 newline, 854 newline,
855 newline, 855 newline,
856 856
857 string "if (mysql_stmt_execute(stmt)) uw_error(ctx, FATAL, \"", 857 string "if (mysql_stmt_execute(stmt)) {",
858 string (ErrorMsg.spanToString loc), 858 newline,
859 string ": Error executing query: %s\\n%s\", ", 859 box [string "if (mysql_errno(conn->conn) == 1213)",
860 query, 860 newline,
861 string ", mysql_error(conn->conn));", 861 box [string "uw_error(ctx, UNLIMITED_RETRY, \"Deadlock detected\");",
862 newline],
863 newline,
864 string "uw_error(ctx, FATAL, \"",
865 string (ErrorMsg.spanToString loc),
866 string ": Error executing query: %s\\n%s\", ",
867 query,
868 string ", mysql_error(conn->conn));",
869 newline],
870 string "}",
862 newline, 871 newline,
863 newline, 872 newline,
864 873
865 string "if (mysql_stmt_bind_result(stmt, out)) uw_error(ctx, FATAL, \"", 874 string "if (mysql_stmt_bind_result(stmt, out)) uw_error(ctx, FATAL, \"",
866 string (ErrorMsg.spanToString loc), 875 string (ErrorMsg.spanToString loc),