mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
fixed
BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK" (added waiting for global_read_lock in mysql_rename_tables) mysql-test/r/rename.result: added test for BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK" mysql-test/t/rename.test: added test for BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK" sql/sql_rename.cc: fixed BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK" (added waiting for global_read_lock)
This commit is contained in:
@ -35,3 +35,27 @@ select * from t3;
|
||||
|
||||
# This should give a warning for t4
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
|
||||
#
|
||||
# Test-case for Bug #2397 RENAME TABLES is not blocked by
|
||||
# FLUSH TABLES WITH READ LOCK
|
||||
#
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
connection con1;
|
||||
CREATE TABLE t1 (a int);
|
||||
CREATE TABLE t3 (a int);
|
||||
connection con2;
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
connection con1;
|
||||
send RENAME TABLE t1 TO t2, t3 to t4;
|
||||
connection con2;
|
||||
sleep 1;
|
||||
show tables;
|
||||
UNLOCK TABLES;
|
||||
sleep 1;
|
||||
show tables;
|
||||
|
||||
drop table t2, t4;
|
||||
|
Reference in New Issue
Block a user