summaryrefslogtreecommitdiff
path: root/mysql-test/t/rename.test
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2004-04-01 22:47:09 +0500
committerunknown <vva@eagle.mysql.r18.ru>2004-04-01 22:47:09 +0500
commit9be599fc3da6e6d9b7bf1aa4836af93ca30bbf5d (patch)
tree97f888ec2a178d85bbfa05fcfe5f91a1282adfbb /mysql-test/t/rename.test
parentb26165d3a2eeb748b9bd5573f9bac7b73d5f9a37 (diff)
downloadmariadb-git-9be599fc3da6e6d9b7bf1aa4836af93ca30bbf5d.tar.gz
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)
Diffstat (limited to 'mysql-test/t/rename.test')
-rw-r--r--mysql-test/t/rename.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test
index 48a9cb401d9..bea0641ad23 100644
--- a/mysql-test/t/rename.test
+++ b/mysql-test/t/rename.test
@@ -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;