mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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/r/lock_multi.result: Test case for bug#17264. mysql-test/t/lock_multi.test: Test case for bug#17264
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user