summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authordavi@endora.local <>2007-11-22 10:18:19 -0200
committerdavi@endora.local <>2007-11-22 10:18:19 -0200
commit351c47415314cad3623be6689e4205bc6f31ca0c (patch)
tree1f1004e1f043e7abf2b7ea25947a3f167bd05e2d /sql
parent9799d6c479f86458b36cfd0382caa6852642f14f (diff)
downloadmariadb-git-351c47415314cad3623be6689e4205bc6f31ca0c.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.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_parse.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0a8b92d28c0..e587a9f3561 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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;