summaryrefslogtreecommitdiff
path: root/mysql-test/t/flush.test
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-03-10 17:35:25 +0300
committerKonstantin Osipov <kostja@sun.com>2010-03-10 17:35:25 +0300
commit7fe455a6bcbb2ba528bf77fc0f718b0c240895d0 (patch)
treeb667012a42bba730f604b785006dda50d6c1bbdb /mysql-test/t/flush.test
parent366a68bb460fea577719335efcfac8e14f13a077 (diff)
downloadmariadb-git-7fe455a6bcbb2ba528bf77fc0f718b0c240895d0.tar.gz
A fix and a test case for Bug#51710 FLUSH TABLES <view> WITH READ
LOCK kills the server. Prohibit FLUSH TABLES WITH READ LOCK application to views or temporary tables. Fix a subtle bug in the implementation when we actually did not remove table share objects from the table cache after acquiring exclusive locks. mysql-test/r/flush.result: Update results (Bug#51710) mysql-test/t/flush.test: Add a test case for Bug#51710. sql/sql_parse.cc: Fix Bug#51710 "FLUSH TABLES <view> WITH READ LOCK killes the server. Ensure we don't open views and temporary tables. Fix a yet another bug in the implementation which did not actually remove the tables from cache after acquiring exclusive locks.
Diffstat (limited to 'mysql-test/t/flush.test')
-rw-r--r--mysql-test/t/flush.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index 582d2562fc6..0d406338394 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -324,3 +324,34 @@ disconnect con1;
--source include/wait_until_disconnected.inc
connection default;
drop table t1, t2, t3;
+
+--echo #
+--echo # Bug#51710 FLUSH TABLES <view> WITH READ LOCK kills the server
+--echo #
+--disable_warnings
+drop view if exists v1, v2, v3;
+drop table if exists t1, v1;
+--enable_warnings
+create table t1 (a int);
+create view v1 as select 1;
+create view v2 as select * from t1;
+create view v3 as select * from v2;
+
+--error ER_WRONG_OBJECT
+flush table v1, v2, v3 with read lock;
+--error ER_WRONG_OBJECT
+flush table v1 with read lock;
+--error ER_WRONG_OBJECT
+flush table v2 with read lock;
+--error ER_WRONG_OBJECT
+flush table v3 with read lock;
+create temporary table v1 (a int);
+--error ER_WRONG_OBJECT
+flush table v1 with read lock;
+drop view v1;
+create table v1 (a int);
+flush table v1 with read lock;
+drop temporary table v1;
+unlock tables;
+drop view v2, v3;
+drop table t1, v1;