summaryrefslogtreecommitdiff
path: root/mysql-test/t/xa.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/xa.test')
-rw-r--r--mysql-test/t/xa.test42
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test
index 3fd243398a9..47ea4981314 100644
--- a/mysql-test/t/xa.test
+++ b/mysql-test/t/xa.test
@@ -245,6 +245,48 @@ XA PREPARE 'x';
XA ROLLBACK 'x';
+--echo #
+--echo # Bug#59986 Assert in Diagnostics_area::set_ok_status() for XA COMMIT
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a)) engine=InnoDB;
+INSERT INTO t1 VALUES (1, 1), (2, 2);
+
+--echo # Connection con1
+connect (con1, localhost, root);
+XA START 'a';
+UPDATE t1 SET b= 3 WHERE a=1;
+
+--echo # Connection default
+connection default;
+XA START 'b';
+UPDATE t1 SET b=4 WHERE a=2;
+--echo # Sending:
+--send UPDATE t1 SET b=5 WHERE a=1
+
+--echo # Connection con1
+connection con1;
+--sleep 1
+--error ER_LOCK_DEADLOCK
+UPDATE t1 SET b=6 WHERE a=2;
+# This used to trigger the assert
+--error ER_XA_RBDEADLOCK
+XA COMMIT 'a';
+
+--echo # Connection default
+connection default;
+--echo # Reaping: UPDATE t1 SET b=5 WHERE a=1
+--reap
+XA END 'b';
+XA ROLLBACK 'b';
+DROP TABLE t1;
+disconnect con1;
+
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc