• Jon Olav Hauglid's avatar
    Bug #51336 Assert in reload_acl_and_cache during RESET QUERY CACHE · 24a9d6ac
    Jon Olav Hauglid authored
    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.
    24a9d6ac
implicit_commit.test 19.6 KB