• Jon Olav Hauglid's avatar
    Bug #50786 Assertion `thd->mdl_context.trans_sentinel() == __null' · e190a415
    Jon Olav Hauglid authored
               failed in open_ltable()
    
    The problem was too restrictive asserts that enforced that 
    open_ltable() was called without any active HANDLERs, LOCK TABLES
    or global read locks. 
    
    However, this can happen in several cases when opening system
    tables. The assert would, for example, be triggered when drop
    function was called from a connection with active HANDLERs as
    this would cause open_ltable() to be called for mysql.proc.
    The assert could also be triggered when using table-based
    general log (mysql.general_log).
    
    This patch removes the asserts since they will be triggered in
    several legitimate cases and because the asserts are no longer
    relevant due to changes in how locks are released.
    
    The patch also fixes set_needs_thr_lock_abort() that before 
    ignored its parameter and always set the member variable to TRUE.
    
    Test case added to mdl_sync.test.
    Thanks to Dmitry Lenev for help with this bug!
    e190a415
mdl.h 23.6 KB