mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31903 Server crashes in _ma_reset_history upon UNLOCK table with auto-create history partitions
When INSERT does auto-create for t1 all its handler instances are closed by alter_close_table(). At this time down the stack maria_close() clears share->state_history. Later when we unlock the tables Aria transaction manager accesses old share instance (the one before t1 was closed) and tries to reset its state_history. The problem is maria_close() didn't remove table from transaction's list (used_tables). The fix does _ma_remove_table_from_trnman() which is triggered by HA_EXTRA_PREPARE_FOR_RENAME.
This commit is contained in:
@@ -7753,7 +7753,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
||||
ERROR_INJECT("add_partition_1") ||
|
||||
mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
|
||||
ERROR_INJECT("add_partition_2") ||
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED) ||
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME) ||
|
||||
ERROR_INJECT("add_partition_3") ||
|
||||
write_log_add_change_partition(lpt) ||
|
||||
ERROR_INJECT("add_partition_4") ||
|
||||
|
Reference in New Issue
Block a user