From: Dmitry Shulga Date: March 19 2012 7:39am Subject: bzr push into mysql-trunk branch (Dmitry.Shulga:3795 to 3796) Bug#13625834 List-Archive: http://lists.mysql.com/commits/143235 X-Bug: 13625834 Message-Id: <201203190638.q2J6cfI0029847@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3796 Dmitry Shulga 2012-03-19 Fixed bug#13625834 - main.innodb_mysql_lock test fails on debian5.0-x86_64 sporadically. The reason for this bug is that there was a race condition in checking for 'update' state in wait_condition loop and acquiring real transaction lock during execution of statement 'INSERT'. Such race condition arised since there was a time window between the step when server sets a transaction state in 'update' value and when the real lock for transation is acquired. Such race condition could result in successful execution of the following statement 'INSERT INTO t1 VALUES (2)' that else should failed with error ER_LOCK_DEADLOCK. To eliminate this race condition we replaced the conditon of waiting for lock by polling the table information_schema.innodb_trx until transaction will be locked. modified: mysql-test/r/innodb_mysql_lock.result mysql-test/t/innodb_mysql_lock.test 3795 Alfranio Correia 2012-03-17 Post-push fix for BUG#13538891. rpl_deadlock_innodb cannot run with replication system tables. modified: mysql-test/suite/rpl/t/rpl_deadlock_innodb.test === modified file 'mysql-test/r/innodb_mysql_lock.result' --- a/mysql-test/r/innodb_mysql_lock.result 2011-11-20 21:00:25 +0000 +++ b/mysql-test/r/innodb_mysql_lock.result 2012-03-19 07:38:46 +0000 @@ -14,6 +14,7 @@ INSERT INTO t1 VALUES (1); set @@autocommit=0; DROP TABLE t1; # Connection 1 +# Waiting for until transaction will be locked inside innodb subsystem # Connection 1 is now holding the lock. # Issuing insert from connection 1 while connection 2&3 # is waiting for the lock should give a deadlock error. === modified file 'mysql-test/t/innodb_mysql_lock.test' --- a/mysql-test/t/innodb_mysql_lock.test 2011-11-20 21:00:25 +0000 +++ b/mysql-test/t/innodb_mysql_lock.test 2012-03-19 07:38:46 +0000 @@ -34,10 +34,12 @@ set @@autocommit=0; --echo # Connection 1 connection con1; +--echo # Waiting for until transaction will be locked inside innodb subsystem let $wait_condition= - SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE info = "INSERT INTO t1 VALUES (1)" and - state = "update"; + SELECT COUNT(*) = 1 FROM information_schema.innodb_trx + WHERE trx_query = 'INSERT INTO t1 VALUES (1)' AND + trx_operation_state = 'inserting' AND + trx_state = 'LOCK WAIT'; --source include/wait_condition.inc let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist No bundle (reason: useless for push emails).