diff options
-rw-r--r-- | mysql-test/main/tc_heuristic_recover.test | 4 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/mysql-test/main/tc_heuristic_recover.test b/mysql-test/main/tc_heuristic_recover.test index 8cbf7d61143..10eaf39f370 100644 --- a/mysql-test/main/tc_heuristic_recover.test +++ b/mysql-test/main/tc_heuristic_recover.test @@ -49,7 +49,7 @@ SELECT * FROM t1; # TODO: MDEV-12700 Allow innodb_read_only startup without prior slow shutdown. --source include/kill_mysqld.inc --error 1 ---exec $MYSQLD_LAST_CMD --log-bin=master-bin --binlog-format=mixed --core-file --loose-debug-sync-timeout=300 --innodb-force-recovery=4 +--exec $MYSQLD_LAST_CMD --log-bin=master-bin --binlog-format=mixed --core-file --loose-debug-sync-timeout=300 --debug_dbug="+d,innobase_xa_fail"; --let SEARCH_PATTERN= was in the XA prepared state --source include/search_pattern_in_file.inc @@ -59,7 +59,7 @@ SELECT * FROM t1; --source include/search_pattern_in_file.inc --error 1 ---exec $MYSQLD_LAST_CMD --log-bin=master-bin --binlog-format=mixed --core-file --loose-debug-sync-timeout=300 --innodb-force-recovery=4 --tc-heuristic-recover=COMMIT +--exec $MYSQLD_LAST_CMD --log-bin=master-bin --binlog-format=mixed --core-file --loose-debug-sync-timeout=300 --debug_dbug="+d,innobase_xa_fail" --tc-heuristic-recover=COMMIT --let SEARCH_PATTERN= was in the XA prepared state --source include/search_pattern_in_file.inc --let SEARCH_PATTERN= Found 1 prepared transactions! diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 2e500147ba3..96e079f51d2 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -16702,6 +16702,9 @@ innobase_commit_by_xid( { DBUG_ASSERT(hton == innodb_hton_ptr); + DBUG_EXECUTE_IF("innobase_xa_fail", + return XAER_RMFAIL;); + if (high_level_read_only) { return(XAER_RMFAIL); } @@ -16734,6 +16737,9 @@ innobase_rollback_by_xid( { DBUG_ASSERT(hton == innodb_hton_ptr); + DBUG_EXECUTE_IF("innobase_xa_fail", + return XAER_RMFAIL;); + if (high_level_read_only) { return(XAER_RMFAIL); } |