summaryrefslogtreecommitdiff
path: root/mysql-test/r/xa.result
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2012-01-20 16:03:39 +0600
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2012-01-20 16:03:39 +0600
commit752496999e661074613459c2f12bc73e21540386 (patch)
tree60d143e5cd08ffbb7a0f5f311aa74768534cdafe /mysql-test/r/xa.result
parent37fce0ece437daf6035e6f6ecd6ec6342b0d224a (diff)
downloadmariadb-git-752496999e661074613459c2f12bc73e21540386.tar.gz
Patch for bug#13070308 - VALGRIND failure in XA test.
The issue is that xa.test failed sporadically on some platforms. The reason for the test failure is a race condition in xa.test. The race condition occures between connection that executes statement INSERT INTO t2 SELECT FROM t1 and other connection that tries to run statements DELETE FROM t1 and COMMIT. If COMMIT statement had been executed before the statement INSERT INTO t2 SELECT FROM t1 was locked by lock on table t1 (as a result of query from table t1) then the INSERT statement is executed successfully and a following test for deadlock would failed. This patch fixes this race condition by moving COMMIT statement after commit of distributed transaction from concurrent session.
Diffstat (limited to 'mysql-test/r/xa.result')
-rw-r--r--mysql-test/r/xa.result8
1 files changed, 5 insertions, 3 deletions
diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result
index 7b580abb19f..6db257eafd5 100644
--- a/mysql-test/r/xa.result
+++ b/mysql-test/r/xa.result
@@ -206,8 +206,8 @@ DROP TABLE t1;
# FAILED
#
DROP TABLE IF EXISTS t1, t2;
-CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a INT);
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
# Connection con2
@@ -217,12 +217,14 @@ INSERT INTO t2 SELECT a FROM t1;
# Connection default
# Waiting until INSERT ... is blocked
DELETE FROM t1;
-COMMIT;
# Connection con2
# Reaping: INSERT INTO t2 SELECT a FROM t1
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
XA COMMIT 'xid1';
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
+# Connection default
+COMMIT;
+# Connection con2
XA START 'xid1';
XA END 'xid1';
XA PREPARE 'xid1';