3796 Dmitry Shulga 2012-03-19
Fixed bug#13625834 - main.innodb_mysql_lock test fails on debian5.0-x86_64
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
To eliminate this race condition we replaced the conditon of waiting for
lock by polling the table information_schema.innodb_trx until transaction will
3795 Alfranio Correia 2012-03-17
Post-push fix for BUG#13538891.
rpl_deadlock_innodb cannot run with replication system tables.
=== 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);
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
+--echo # Waiting for until transaction will be locked inside innodb subsystem
- 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';
SELECT COUNT(*) = 1 FROM information_schema.processlist
No bundle (reason: useless for push emails).
|• bzr push into mysql-trunk branch (Dmitry.Shulga:3795 to 3796) Bug#13625834||Dmitry Shulga||19 Mar|