summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-09-03 17:42:53 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-09-03 17:56:19 +0530
commit635eb7aecbd442f0baf97c259333ed20d566565d (patch)
tree67e2e3a5ff687df999f4c74ae8e417e4d867b88e
parent4f3cfddad0506e36c779b50278a5ea8fe073ec1c (diff)
downloadmariadb-git-10.5-MDEV-19514.tar.gz
- Fixes main.tc_heuristic_recover test case hang.10.5-MDEV-19514
-rw-r--r--mysql-test/main/tc_heuristic_recover.test4
-rw-r--r--storage/innobase/handler/ha_innodb.cc6
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);
}