mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
Merge emurphy@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/emurphy/mysql-5.0-heikki
This commit is contained in:
commit
6043f29810
3 changed files with 43 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue