• Davi Arnaut's avatar
    Bug#42643: InnoDB does not support replication of TRUNCATE TABLE · 3c279d9a
    Davi Arnaut authored
    The problem was that TRUNCATE TABLE didn't take a exclusive
    lock on a table if it resorted to truncating via delete of
    all rows in the table. Specifically for InnoDB tables, this
    could break proper isolation as InnoDB ends up aborting some
    granted locks when truncating a table.
    
    The solution is to take a exclusive metadata lock before
    TRUNCATE TABLE can proceed. This guarantees that no other
    transaction is using the table.
    
    Incompatible change: Truncate via delete no longer fails
    if sql_safe_updates is activated (this was a undocumented
    side effect).
    3c279d9a
mdl_sync.test 106 KB