diff options
author | unknown <davi@endora.local> | 2007-11-22 10:18:19 -0200 |
---|---|---|
committer | unknown <davi@endora.local> | 2007-11-22 10:18:19 -0200 |
commit | 4548b328bb974cf0d6cde0386f60c100f9a52e2a (patch) | |
tree | 1f1004e1f043e7abf2b7ea25947a3f167bd05e2d /mysql-test/t/flush.test | |
parent | 90e09bfbdb6c40f5cfe26d7aeebd985ea82480bf (diff) | |
download | mariadb-git-4548b328bb974cf0d6cde0386f60c100f9a52e2a.tar.gz |
Bug#32528 Global read lock with a low priority write lock causes a server crash
FLUSH TABLES WITH READ LOCK fails to properly detect write locked
tables when running under low priority updates.
The problem is that when trying to aspire a global read lock, the
reload_acl_and_cache() function fails to properly check if the thread
has a low priority write lock, which later my cause a server crash or
deadlock.
The solution is to simple check if the thread has any type of the
possible exclusive write locks.
mysql-test/r/flush.result:
Add test case result for Bug#32528
mysql-test/t/flush.test:
Add test case for Bug#32528
sql/sql_parse.cc:
Although it should not matter under LOCK TABLES, use TL_WRITE_ALLOW_WRITE
to emphasize that it should fail in case of any write lock.
Diffstat (limited to 'mysql-test/t/flush.test')
-rw-r--r-- | mysql-test/t/flush.test | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 3a4f2f2f5f2..72efa8a2ee6 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -133,4 +133,35 @@ disconnect con3; connection default; drop table t1, t2; +# +# Bug#32528 Global read lock with a low priority write lock causes a server crash +# + +--disable_warnings +drop table if exists t1, t2; +--enable_warnings + +set session low_priority_updates=1; + +create table t1 (a int); +create table t2 (b int); + +lock tables t1 write; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +flush tables with read lock; +unlock tables; + +lock tables t1 read, t2 write; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +flush tables with read lock; +unlock tables; + +lock tables t1 read; +flush tables with read lock; +unlock tables; + +drop table t1, t2; + +set session low_priority_updates=default; + # End of 5.0 tests |