• Marko Mäkelä's avatar
    MDEV-25524 heap-use-after-free in fil_space_t::rename() · 54e2e701
    Marko Mäkelä authored
    In commit 91599701 (MDEV-25312)
    some recovery code for TRUNCATE TABLE was broken
    causing a regression in a case where undo log for a RENAME TABLE
    operation had been durably written but the tablespace had not been
    renamed yet.
    
    row_rename_table_for_mysql(): Add a DEBUG_SYNC point for the
    test case, and simplify the logic and trim the error messages.
    
    fil_space_t::rename(): Simplify the operation. Merge the necessary
    part of fil_rename_tablespace_check(). If there is no change to
    the file name, do nothing.
    
    dict_table_t::rename_tablespace(): Refactored from
    dict_table_rename_in_cache().
    
    row_undo_ins_parse_undo_rec(): On rolling back TRX_UNDO_RENAME_TABLE,
    invoke dict_table_t::rename_tablespace() even if the table name matches.
    
    os_file_rename_func(): Temporarily relax an assertion that would
    fail during the recovery in the test innodb.truncate_crash.
    54e2e701
foreign_key.test 27.1 KB