List:Commits« Previous MessageNext Message »
From:sergeyv Date:March 10 2006 4:56pm
Subject:bk commit into 5.0 tree (SergeyV:1.2087) BUG#17264
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of sergeyv. When sergeyv 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.2087 06/03/10 19:56:20 SergeyV@selena. +3 -0
  Fixes bug #17264. 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.

  sql/ha_innodb.cc
    1.287 06/03/10 19:56:09 SergeyV@selena. +11 -0
    Fixes bug #17264. 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.

  mysql-test/t/lock_multi.test
    1.14 06/03/10 19:56:08 SergeyV@selena. +26 -0
    Test case for #17264 patch

  mysql-test/r/lock_multi.result
    1.16 06/03/10 19:56:07 SergeyV@selena. +6 -0
    Result file update for #17264 test

# 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:	SergeyV
# Host:	selena.
# Root:	H:/MYSQL/src/#17264-mysql-5.0

--- 1.286/sql/ha_innodb.cc	2006-01-31 21:41:42 +03:00
+++ 1.287/sql/ha_innodb.cc	2006-03-10 19:56:09 +03:00
@@ -6889,6 +6889,17 @@
 		    && !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.15/mysql-test/r/lock_multi.result	2005-09-15 23:17:37 +04:00
+++ 1.16/mysql-test/r/lock_multi.result	2006-03-10 19:56:07 +03:00
@@ -43,3 +43,9 @@
 a	int(11)	YES		NULL	
 unlock tables;
 drop table t1;
+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.13/mysql-test/t/lock_multi.test	2005-09-15 23:17:37 +04:00
+++ 1.14/mysql-test/t/lock_multi.test	2006-03-10 19:56:08 +03:00
@@ -107,3 +107,29 @@
 connection locker;
 unlock tables;
 drop table t1;
+
+#
+# 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;
Thread
bk commit into 5.0 tree (SergeyV:1.2087) BUG#17264sergeyv10 Mar