diff options
author | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2011-03-07 10:08:10 +0100 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2011-03-07 10:08:10 +0100 |
commit | bafe24035dbf6d5452d7328ab45d6b43abe52d54 (patch) | |
tree | 90ad3b6bd3ba85aa5e2dbab781118c94cb262196 /mysql-test/r/flush.result | |
parent | b326b9a3a00767cdab2d842dc7c318a8de8462a5 (diff) | |
download | mariadb-git-bafe24035dbf6d5452d7328ab45d6b43abe52d54.tar.gz |
Bug #11764779 (former 57649)
FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads
to assert failure.
This assert was triggered if a statement tried up upgrade a metadata
lock with an active FLUSH TABLE <list> WITH READ LOCK. The assert
checks that the connection already holds a global intention exclusive
metadata lock. However, FLUSH TABLE <list> WITH READ LOCK does not
acquire this lock in order to be compatible with FLUSH TABLES WITH
READ LOCK. Therefore any metadata lock upgrade caused the assert to
be triggered.
This patch fixes the problem by preventing metadata lock upgrade
if the connection has an active FLUSH TABLE <list> WITH READ LOCK.
ER_TABLE_NOT_LOCKED_FOR_WRITE will instead be reported to the client.
Test case added to flush.test.
Diffstat (limited to 'mysql-test/r/flush.result')
-rw-r--r-- | mysql-test/r/flush.result | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index b1e2e48eca8..bbfea2dade8 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -451,3 +451,18 @@ unlock tables; handler t1 close; # Cleanup. drop tables t1, t2; +# +# Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads +# to assert failure. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT); +FLUSH TABLES t1 WITH READ LOCK; +FLUSH TABLES; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +ALTER TABLE t1 COMMENT 'test'; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +UNLOCK TABLES; +DROP TABLE t1; |