diff options
author | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-02-26 10:58:33 +0100 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-02-26 10:58:33 +0100 |
commit | a42cbe060c989ddc3d181a687b9628c459830c2c (patch) | |
tree | 8bcbce663776813ce9509a92991f45ffba1e8302 /mysql-test/t/query_cache.test | |
parent | 3f1a9baf0b9b9a6395763ff730a60bc5d1b74d85 (diff) | |
download | mariadb-git-a42cbe060c989ddc3d181a687b9628c459830c2c.tar.gz |
Bug #51336 Assert in reload_acl_and_cache during RESET QUERY CACHE
Attempts to execute RESET statements within a transaction that
had acquired metadata locks, led to an assertion failure on
debug servers. This bug didn't cause any problems on release
builds.
The triggered assert is designed to check that caches are not
flushed or reset while having active transactions. It is triggered
if acquired metadata locks exist that are not from LOCK TABLE or
HANDLER statements.
In this case it was triggered by RESET QUERY CACHE while having
an active transaction that had acquired locks. The reason the
assertion was triggered, was that RESET statements, unlike the
similar FLUSH statements, was not causing an implicit commit.
This patch fixes the problem by making sure RESET statements
commit the current transaction before executing. The commit
causes acquired metadata locks to be released, preventing the
assertion from being triggered.
Incompatible change: This patch changes RESET statements so
that they cause an implicit commit.
Test case added to query_cache.test.
Diffstat (limited to 'mysql-test/t/query_cache.test')
-rw-r--r-- | mysql-test/t/query_cache.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 993f231759b..ce49ca89eca 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -1363,3 +1363,22 @@ SELECT SQL_CACHE * FROM t1 WHERE a IN DROP TABLE t1; --echo End of 5.1 tests + + +--echo # +--echo # Bug#51336 Assert in reload_acl_and_cache during RESET QUERY CACHE +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1(id INT); + +START TRANSACTION; +SELECT * FROM t1; +# This caused an assert +RESET QUERY CACHE; + +COMMIT; +DROP TABLE t1; |