From a42cbe060c989ddc3d181a687b9628c459830c2c Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Fri, 26 Feb 2010 10:58:33 +0100 Subject: 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. --- mysql-test/t/implicit_commit.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/t/implicit_commit.test') diff --git a/mysql-test/t/implicit_commit.test b/mysql-test/t/implicit_commit.test index d8ffd6e9452..b10788bd891 100644 --- a/mysql-test/t/implicit_commit.test +++ b/mysql-test/t/implicit_commit.test @@ -697,6 +697,10 @@ source include/implicit_commit_helper.inc; --echo # SQLCOM_RESET --echo # +let $statement= + reset query cache; +source include/implicit_commit_helper.inc; + --echo # --echo # SQLCOM_PURGE --echo # -- cgit v1.2.1