=== modified file 'mysql-test/r/mysqld--help-notwin.result' --- mysql-test/r/mysqld--help-notwin.result 2014-02-25 10:40:20 +0000 +++ mysql-test/r/mysqld--help-notwin.result 2014-07-09 11:52:47 +0000 @@ -942,7 +942,7 @@ The number of table cache instances --tc-heuristic-recover=name Decision to use in heuristic recover process. Possible - values are COMMIT or ROLLBACK. + values are NONE, COMMIT, or ROLLBACK. --thread-cache-size=# How many threads we should keep in a cache for reuse --thread-handling=name @@ -1255,7 +1255,7 @@ sync-relay-log-info 10000 sysdate-is-now FALSE table-open-cache-instances 1 -tc-heuristic-recover COMMIT +tc-heuristic-recover NONE thread-cache-size 9 thread-handling one-thread-per-connection thread-stack 262144 === added file 'mysql-test/r/tc-heuristic-recover.result' --- mysql-test/r/tc-heuristic-recover.result 1970-01-01 00:00:00 +0000 +++ mysql-test/r/tc-heuristic-recover.result 2014-07-09 15:55:11 +0000 @@ -0,0 +1,23 @@ +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +BEGIN; +INSERT INTO t1 VALUES (2); +SET SESSION debug="d,crash_commit_after_prepare"; +COMMIT; +Got one of the listed errors +Restarting with --tc-heuristic-recover=ROLLBACK +2 should be absent: +SELECT * FROM t1; +a +1 +BEGIN; +INSERT INTO t1 VALUES (2); +SET SESSION debug="d,crash_commit_after_prepare"; +COMMIT; +Got one of the listed errors +Restarting with --tc-heuristic-recover=COMMIT +2 should be absent too as current server replaces COMMIT with ROLLBACK: +SELECT * FROM t1; +a +1 +DROP TABLE t1; === added file 'mysql-test/t/tc-heuristic-recover.test' --- mysql-test/t/tc-heuristic-recover.test 1970-01-01 00:00:00 +0000 +++ mysql-test/t/tc-heuristic-recover.test 2014-07-09 15:54:35 +0000 @@ -0,0 +1,50 @@ +--source include/not_embedded.inc +--source include/not_valgrind.inc +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_log_bin.inc + +let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +let $restart_log= $MYSQLTEST_VARDIR/log/mysqld.1.restart.err; + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; + +INSERT INTO t1 VALUES (1); + +BEGIN; +INSERT INTO t1 VALUES (2); +SET SESSION debug="d,crash_commit_after_prepare"; +--exec echo "wait" > $restart_file +--error 2006, 2013 +COMMIT; + +--source include/wait_until_disconnected.inc +--echo Restarting with --tc-heuristic-recover=ROLLBACK +--error 1 +--exec $MYSQLD_CMD --tc-heuristic-recover=ROLLBACK --console > $restart_log 2>&1 +--exec echo "restart" > $restart_file +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo 2 should be absent: +SELECT * FROM t1; + +BEGIN; +INSERT INTO t1 VALUES (2); +SET SESSION debug="d,crash_commit_after_prepare"; +--exec echo "wait" > $restart_file +--error 2006, 2013 +COMMIT; + +--source include/wait_until_disconnected.inc +--echo Restarting with --tc-heuristic-recover=COMMIT +--error 1 +--exec $MYSQLD_CMD --tc-heuristic-recover=COMMIT --console >> $restart_log 2>&1 +--exec echo "restart" > $restart_file +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo 2 should be absent too as current server replaces COMMIT with ROLLBACK: +SELECT * FROM t1; + +DROP TABLE t1; === modified file 'sql/mysqld.cc' --- sql/mysqld.cc 2014-03-04 05:13:07 +0000 +++ sql/mysqld.cc 2014-07-09 11:52:47 +0000 @@ -294,7 +294,7 @@ static const char *tc_heuristic_recover_names[]= { - "COMMIT", "ROLLBACK", NullS + "NONE", "COMMIT", "ROLLBACK", NullS }; static TYPELIB tc_heuristic_recover_typelib= { @@ -7302,8 +7302,8 @@ &global_system_variables.sysdate_is_now, 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, {"tc-heuristic-recover", 0, - "Decision to use in heuristic recover process. Possible values are COMMIT " - "or ROLLBACK.", &tc_heuristic_recover, &tc_heuristic_recover, + "Decision to use in heuristic recover process. Possible values are NONE, " + "COMMIT, or ROLLBACK.", &tc_heuristic_recover, &tc_heuristic_recover, &tc_heuristic_recover_typelib, GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #if defined(ENABLED_DEBUG_SYNC) {"debug-sync-timeout", OPT_DEBUG_SYNC_TIMEOUT,