1
0
mirror of https://github.com/MariaDB/server.git synced 2025-06-13 13:01:51 +03:00

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.
This commit is contained in:
unknown
2007-11-22 10:18:19 -02:00
parent 2aa5037c7a
commit 719e64e4a5
3 changed files with 49 additions and 1 deletions

View File

@ -7054,7 +7054,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
for (; lock_p < end_p; lock_p++)
{
if ((*lock_p)->type == TL_WRITE)
if ((*lock_p)->type >= TL_WRITE_ALLOW_WRITE)
{
my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0));
return 1;