Commit 6043f298 authored by elliot@mysql.com's avatar elliot@mysql.com

Merge emurphy@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/emurphy/mysql-5.0-heikki
parents c6d2a56b 37e5ec9f
...@@ -67,3 +67,9 @@ Select_priv ...@@ -67,3 +67,9 @@ Select_priv
N N
use test; use test;
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;
...@@ -171,4 +171,30 @@ use test; ...@@ -171,4 +171,30 @@ use test;
# #
connection default; 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 # End of 5.0 tests
...@@ -6684,6 +6684,17 @@ ha_innobase::store_lock( ...@@ -6684,6 +6684,17 @@ ha_innobase::store_lock(
&& !thd->tablespace_op && !thd->tablespace_op
&& thd->lex->sql_command != SQLCOM_TRUNCATE && thd->lex->sql_command != SQLCOM_TRUNCATE
&& thd->lex->sql_command != SQLCOM_OPTIMIZE && 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) { && thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
lock_type = TL_WRITE_ALLOW_WRITE; lock_type = TL_WRITE_ALLOW_WRITE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment