• Monty's avatar
    MDEV-28897 Wrong table.get_ref_count() upon concurrent truncate and backup stage operation · 5e40934d
    Monty authored
    The issue was that flush_tables() didn't take a MDL lock on cached
    TABLE_SHARE before calling open_table() to do a HA_EXTRA_FLUSH call.
    Most engines seams to have no issue with it, but apparantly this conflicts
    with InnoDB in 10.6 when using TRUNCATE
    
    Fixed by taking a MDL lock before trying to open the table in
    flush_tables().
    
    There is no test case as it hard to repeat the scheduling that causes
    the error. I did run the test case in MDEV-28897 to verify
    that the bug is fixed.
    5e40934d
sql_base.cc 304 KB