1
0
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:
Aleksey Midenkov
2024-04-02 00:11:34 +03:00
parent a79fb66a98
commit d966e55c0a
3 changed files with 40 additions and 1 deletions

View File

@@ -3447,4 +3447,22 @@ ERROR HY000: Maybe missing parameters: no rotation condition for multiple HISTOR
#
# End of 10.5 tests
#
#
# MDEV-31903 Server crashes in _ma_reset_history upon UNLOCK table with auto-create history partitions
#
set timestamp= unix_timestamp('2000-01-01 00:00:00');
create table t1 (x int) engine=aria with system versioning partition by system_time interval 1 hour auto partitions 3;
insert into t1 values (1);
create table t2 (x int) engine=aria;
create trigger tr after insert on t2 for each row update t1 set x= x + 11;
lock tables t1 write, t2 write;
update t1 set x= x + 1;
set timestamp= unix_timestamp('2000-01-01 13:00:00');
insert into t2 values (5);
unlock tables;
drop table t1, t2;
set timestamp= default;
#
# End of 10.9 tests
#
set global innodb_stats_persistent= @save_persistent;