diff options
-rw-r--r-- | mysql-test/main/alter_table_online_debug.result | 17 | ||||
-rw-r--r-- | mysql-test/main/alter_table_online_debug.test | 25 | ||||
-rw-r--r-- | sql/log.cc | 2 |
3 files changed, 43 insertions, 1 deletions
diff --git a/mysql-test/main/alter_table_online_debug.result b/mysql-test/main/alter_table_online_debug.result index 337699954a8..7c30944d56f 100644 --- a/mysql-test/main/alter_table_online_debug.result +++ b/mysql-test/main/alter_table_online_debug.result @@ -919,5 +919,22 @@ alter table t1 force; drop table t1, t2; set debug_sync= reset; # +# MDEV-29038 XA assertions failing in binlog_rollback and binlog_commit +# +create table t (a int); +insert into t values (1); +xa begin 'xid'; +set debug_sync= 'now wait_for downgraded'; +connect con1,localhost,root,,test; +set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit'; +alter table t force, algorithm=copy, lock=none; +connection default; +insert into t values (2); +set debug_sync= 'now signal goforit'; +xa end 'xid'; +xa rollback 'xid'; +drop table t; +set debug_sync= reset; +# # End of 10.10 tests # diff --git a/mysql-test/main/alter_table_online_debug.test b/mysql-test/main/alter_table_online_debug.test index c482ba0d36c..d8c4e606a8d 100644 --- a/mysql-test/main/alter_table_online_debug.test +++ b/mysql-test/main/alter_table_online_debug.test @@ -1089,5 +1089,30 @@ drop table t1, t2; set debug_sync= reset; --echo # +--echo # MDEV-29038 XA assertions failing in binlog_rollback and binlog_commit +--echo # +create table t (a int); +insert into t values (1); +xa begin 'xid'; +--send +set debug_sync= 'now wait_for downgraded'; + +--connect (con1,localhost,root,,test) +set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit'; +--send +alter table t force, algorithm=copy, lock=none; + +--connection default +--reap +insert into t values (2); +set debug_sync= 'now signal goforit'; +xa end 'xid'; +xa rollback 'xid'; + +# Cleanup +drop table t; +set debug_sync= reset; + +--echo # --echo # End of 10.10 tests --echo # diff --git a/sql/log.cc b/sql/log.cc index 42bb9a3d91c..4198c311adb 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2408,7 +2408,7 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) if (!cache_mngr) { DBUG_ASSERT(WSREP(thd) || rollback_online); - DBUG_ASSERT(thd->lex->sql_command != SQLCOM_XA_ROLLBACK); + DBUG_ASSERT(thd->lex->sql_command != SQLCOM_XA_ROLLBACK || rollback_online); DBUG_RETURN(0); } |