List:Commits« Previous MessageNext Message »
From:Elliot Murphy Date:June 20 2006 5:43pm
Subject:bk commit into 5.0 tree (elliot:1.2192) BUG#17264
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of emurphy. When emurphy does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2192 06/06/20 13:43:13 elliot@stripped +3 -0
  Applying patch from SergeyV
  Fixes bug#17264, for alter table on win32 for successfull operation completion
  it is used TL_WRITE(=10) lock instead of TL_WRITE_ALLOW_READ(=6), however here
  in innodb handler TL_WRTIE is lifted to TL_WRITE_ALLOW_WRITE, which causes
  race condition when several clients do alter table simultaneously.

  sql/ha_innodb.cc
    1.296 06/06/20 13:43:10 elliot@stripped +11 -0
    Applying patch from SergeyV
    Fixes bug#17264, for alter table on win32 for successfull operation completion
    it is used TL_WRITE(=10) lock instead of TL_WRITE_ALLOW_READ(=6), however here
    in innodb handler TL_WRTIE is lifted to TL_WRITE_ALLOW_WRITE, which causes
    race condition when several clients do alter table simultaneously.

  mysql-test/t/lock_multi.test
    1.16 06/06/20 13:43:10 elliot@stripped +26 -0
    Test case for bug#17264

  mysql-test/r/lock_multi.result
    1.18 06/06/20 13:43:10 elliot@stripped +6 -0
    Test case for bug#17264.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	elliot
# Host:	scared.(none)
# Root:	/home/emurphy/src/bk-clean/mysql-5.0-heikki

--- 1.295/sql/ha_innodb.cc	2006-05-15 11:07:14 -04:00
+++ 1.296/sql/ha_innodb.cc	2006-06-20 13:43:10 -04:00
@@ -6684,6 +6684,17 @@ ha_innobase::store_lock(
 		    && !thd->tablespace_op
 		    && thd->lex->sql_command != SQLCOM_TRUNCATE
 		    && thd->lex->sql_command != SQLCOM_OPTIMIZE
+#ifdef __WIN__
+                /* 
+                   for alter table on win32 for succesfull operation 
+                   completion it is used TL_WRITE(=10) lock instead of
+                   TL_WRITE_ALLOW_READ(=6), however here in innodb handler
+                   TL_WRITE is lifted to TL_WRITE_ALLOW_WRITE, which causes
+                   race condition when several clients do alter table 
+                   simultaneously (bug #17264). This fix avoids the problem.
+                */
+                    && thd->lex->sql_command != SQLCOM_ALTER_TABLE
+#endif
 		    && thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
 
 			lock_type = TL_WRITE_ALLOW_WRITE;

--- 1.17/mysql-test/r/lock_multi.result	2006-06-10 06:24:40 -04:00
+++ 1.18/mysql-test/r/lock_multi.result	2006-06-20 13:43:10 -04:00
@@ -67,3 +67,9 @@ Select_priv
 N
 use test;
 use test;
+create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
+lock tables t1 write;
+ alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+ alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+unlock tables;
+drop table t1;

--- 1.15/mysql-test/t/lock_multi.test	2006-06-10 06:24:40 -04:00
+++ 1.16/mysql-test/t/lock_multi.test	2006-06-20 13:43:10 -04:00
@@ -171,4 +171,30 @@ use test;
 #
 connection default;
 
+#
+# Bug #17264: MySQL Server freeze
+#
+connection locker;
+create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
+lock tables t1 write;
+connection writer;
+--sleep 2
+delimiter //;
+send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+delimiter ;//
+connection reader;
+--sleep 2
+delimiter //;
+send alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
+delimiter ;//
+connection locker;
+--sleep 2
+unlock tables;
+connection writer;
+reap;
+connection reader;
+reap;
+connection locker;
+drop table t1;
+
 # End of 5.0 tests
Thread
bk commit into 5.0 tree (elliot:1.2192) BUG#17264Elliot Murphy20 Jun