Skip to content
  • Dmitry Lenev's avatar
    f44cb853
    Fix for bug #27041477 "ASSERTION `HAS_PRELOCKING_LIST ||... · f44cb853
    Dmitry Lenev authored
    Fix for bug #27041477 "ASSERTION `HAS_PRELOCKING_LIST || THD->MDL_CONTEXT.OWNS_EQUAL_OR_STRONGER_LOCK".
    
    Under LOCK TABLES attempt to execute DML statement on a table with
    foreign keys led to assertion failure if this statement was
    incompatible with the mode in which tables were locked.
    
    The problem was that assertion in part of prelocking algorithm
    responsible for handling tables involved in foreign keys under
    LOCK TABLES did not take into account several scenarios in which
    these tables might have been not locked properly.
    
    This patch solves the problem by replacing problematic assertion
    with check if appropriate metadata locks are acquired. If necessary
    locks are missing we now fail with an error instead failing on assert.
    f44cb853
    Fix for bug #27041477 "ASSERTION `HAS_PRELOCKING_LIST ||...
    Dmitry Lenev authored
    Fix for bug #27041477 "ASSERTION `HAS_PRELOCKING_LIST || THD->MDL_CONTEXT.OWNS_EQUAL_OR_STRONGER_LOCK".
    
    Under LOCK TABLES attempt to execute DML statement on a table with
    foreign keys led to assertion failure if this statement was
    incompatible with the mode in which tables were locked.
    
    The problem was that assertion in part of prelocking algorithm
    responsible for handling tables involved in foreign keys under
    LOCK TABLES did not take into account several scenarios in which
    these tables might have been not locked properly.
    
    This patch solves the problem by replacing problematic assertion
    with check if appropriate metadata locks are acquired. If necessary
    locks are missing we now fail with an error instead failing on assert.
Loading