MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Magne Mahre Date:November 12 2009 11:43am
Subject:bzr commit into mysql-5.1-bugteam branch (magne.mahre:3198) Bug#37183
View as plain text  
#At file:///data/z/mysql-5.1-bugteam-37183/ based on revid:christopher.powers@stripped

 3198 Magne Mahre	2009-11-12
      Bug #37183 insert ignore into .. select ... hangs after 
                 deadlock was encountered
      
      The bug is caused by an inconsistent handling of the IGNORE
      clause.  A read from a const table caused a lock timeout
      (ER_LOCK_TIMEOUT) in innodb.  Since the IGNORE clause was
      given, the timeout was converted into a warning instead of
      an error, thus not populating the diagnostics area.  When
      innodb subsequently marked the transaction for rollback,
      mysql asserted since the diag.area was empty.
      
      This patch consists of only a test case, as the bug itself
      was fixed by the patch for Bug #46539

    modified:
      mysql-test/r/innodb_lock_wait_timeout_1.result
      mysql-test/t/innodb_lock_wait_timeout_1.test
=== modified file 'mysql-test/r/innodb_lock_wait_timeout_1.result'
--- a/mysql-test/r/innodb_lock_wait_timeout_1.result	2009-11-03 17:45:52 +0000
+++ b/mysql-test/r/innodb_lock_wait_timeout_1.result	2009-11-12 11:43:33 +0000
@@ -48,6 +48,24 @@ commit;
 set autocommit=default;
 drop table t1;
 #
+# Bug #37183 insert ignore into .. select ... hangs 
+#            after deadlock was encountered
+#
+create table t1(id int primary key,v int)engine=innodb;
+insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
+create table t2 like t1;
+begin;
+update t1 set v=id*2 where id=1;
+begin;
+update t1 set v=id*2 where id=2;
+update t1 set v=id*2 where id=2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+insert ignore into t2 select * from t1 where id=1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+rollback;
+rollback;
+drop table t1, t2;
+#
 # Bug#41756 Strange error messages about locks from InnoDB
 #
 drop table if exists t1;

=== modified file 'mysql-test/t/innodb_lock_wait_timeout_1.test'
--- a/mysql-test/t/innodb_lock_wait_timeout_1.test	2009-11-03 17:45:52 +0000
+++ b/mysql-test/t/innodb_lock_wait_timeout_1.test	2009-11-12 11:43:33 +0000
@@ -71,6 +71,40 @@ set autocommit=default;
 drop table t1;
 
 --echo #
+--echo # Bug #37183 insert ignore into .. select ... hangs 
+--echo #            after deadlock was encountered
+--echo #
+connect (con1,localhost,root,,);
+create table t1(id int primary key,v int)engine=innodb;
+insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
+create table t2 like t1;
+
+--connection con1
+begin;
+update t1 set v=id*2 where id=1;
+
+--connection default
+begin;
+update t1 set v=id*2 where id=2;
+
+--connection con1
+--error 1205
+update t1 set v=id*2 where id=2;
+
+--connection default
+--error 1205
+insert ignore into t2 select * from t1 where id=1; 
+rollback;
+
+--connection con1
+rollback;
+
+--connection default
+disconnect con1;
+drop table t1, t2;
+
+
+--echo #
 --echo # Bug#41756 Strange error messages about locks from InnoDB
 --echo #
 --disable_warnings


Attachment: [text/bzr-bundle] bzr/magne.mahre@sun.com-20091112114333-0ziiuhhc1m2pv7v4.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (magne.mahre:3198) Bug#37183Magne Mahre12 Nov