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

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.
This commit is contained in:
Jon Olav Hauglid
2010-02-26 10:58:33 +01:00
parent 3f1a9baf0b
commit a42cbe060c
6 changed files with 41 additions and 0 deletions

View File

@ -658,6 +658,11 @@ YES
#
# SQLCOM_RESET
#
INSERT INTO db1.trans (a) VALUES (1);
reset query cache;
CALL db1.test_if_commit();
IMPLICIT COMMIT
YES
#
# SQLCOM_PURGE
#