From 4548b328bb974cf0d6cde0386f60c100f9a52e2a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Nov 2007 10:18:19 -0200 Subject: 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. --- mysql-test/r/flush.result | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/r/flush.result') diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index 7eb7fd16edb..ce64e09c1d3 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -55,3 +55,20 @@ flush tables with read lock; insert into t2 values(1); unlock tables; drop table t1, t2; +drop table if exists t1, t2; +set session low_priority_updates=1; +create table t1 (a int); +create table t2 (b int); +lock tables t1 write; +flush tables with read lock; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; +lock tables t1 read, t2 write; +flush tables with read lock; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; +lock tables t1 read; +flush tables with read lock; +unlock tables; +drop table t1, t2; +set session low_priority_updates=default; -- cgit v1.2.1