• Jon Olav Hauglid's avatar
    Bug #51336 Assert in reload_acl_and_cache during RESET QUERY CACHE · a42cbe06
    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.
    a42cbe06
query_cache.result 70.8 KB