diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-08-12 19:29:41 +0400 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-08-12 19:29:41 +0400 |
commit | fdf855e2ef324efbbfaa083c4b5f9bb14ff4d2ff (patch) | |
tree | 007f61f7acc57814e70babbacb4568e9d4d54ef7 /mysql-test | |
parent | 29c4873ad5bb0e0f3eb1faf3f22ec00f11ca5cb4 (diff) | |
download | mariadb-git-fdf855e2ef324efbbfaa083c4b5f9bb14ff4d2ff.tar.gz |
A follow up patch for WL#5000: add a test case
and a comment for the case when a connection
issuing FLUSH TABLES <list> WITH READ LOCK
has an open handler.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/flush.result | 25 | ||||
-rw-r--r-- | mysql-test/t/flush.test | 23 |
2 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index be6562f8ab6..f2b562db478 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -279,3 +279,28 @@ drop temporary table v1; unlock tables; drop view v2, v3; drop table t1, v1; +# +# FLUSH TABLES <list> WITH READ LOCK and HANDLER +# +drop table if exists t1; +create table t1 (a int, key a (a)); +insert into t1 (a) values (1), (2), (3); +handler t1 open; +handler t1 read a next; +a +1 +handler t1 read a next; +a +2 +flush tables t1 with read lock; +handler t1 read a next; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; +# +# Sic: lost handler position. +# +handler t1 read a next; +a +1 +handler t1 close; +drop table t1; diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index cd3df229f10..9996c98de9a 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -407,3 +407,26 @@ drop temporary table v1; unlock tables; drop view v2, v3; drop table t1, v1; + + +--echo # +--echo # FLUSH TABLES <list> WITH READ LOCK and HANDLER +--echo # +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1 (a int, key a (a)); +insert into t1 (a) values (1), (2), (3); +handler t1 open; +handler t1 read a next; +handler t1 read a next; +flush tables t1 with read lock; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +handler t1 read a next; +unlock tables; +--echo # +--echo # Sic: lost handler position. +--echo # +handler t1 read a next; +handler t1 close; +drop table t1; |