• sjaakola's avatar
    MDEV-24119 MDL BF-BF Conflict caused by TRUNCATE TABLE · ad432ef4
    sjaakola authored
    This PR fixes same issue as MDEV-21577 for TRUNCATE TABLE.
    MDEV-21577 fixed TOI replication for OPTIMIZE, REPAIR and ALTER TABLE
    operating on FK child table. It was later found out that also TRUNCATE
    has similar problem and needs a fix.
    
    The actual fix is to do FK parent table lookup before TRUNCATE TOI
    isolation and append found FK parent table names in certification key
    list for the write set.
    
    PR contains also new test scenario in galera_ddl_fk_conflict test where
    FK child has two FK parent tables and there are two DML transactions operating
    on both parent tables.
    
    For development convenience, new TO isolation macro was added:
    WSREP_TO_ISOLATION_BEGIN_IF and WSREP_TO_ISOLATION_BEGIN_ALTER macro was changed
    to skip the goto statement.
    Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
    ad432ef4
galera_ddl_fk_conflict.test 896 Bytes