diff options
author | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2012-01-20 16:03:39 +0600 |
---|---|---|
committer | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2012-01-20 16:03:39 +0600 |
commit | 752496999e661074613459c2f12bc73e21540386 (patch) | |
tree | 60d143e5cd08ffbb7a0f5f311aa74768534cdafe /mysql-test/t/xa.test | |
parent | 37fce0ece437daf6035e6f6ecd6ec6342b0d224a (diff) | |
download | mariadb-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/t/xa.test')
-rw-r--r-- | mysql-test/t/xa.test | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test index 8ce9ce52960..cb4345e9479 100644 --- a/mysql-test/t/xa.test +++ b/mysql-test/t/xa.test @@ -338,8 +338,8 @@ DROP TABLE t1; DROP TABLE IF EXISTS t1, t2; --enable_warnings -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); @@ -359,7 +359,6 @@ let $wait_condition= --echo # Waiting until INSERT ... is blocked --source include/wait_condition.inc DELETE FROM t1; -COMMIT; --echo # Connection con2 --connection con2 @@ -368,6 +367,14 @@ COMMIT; --reap --error ER_XA_RBDEADLOCK XA COMMIT 'xid1'; + +--echo # Connection default +connection default; + +COMMIT; + +--echo # Connection con2 +connection con2; # This caused the assert to be triggered XA START 'xid1'; |