1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-25292 gcol.gcol_bugfixes --ps fix

Related to MDEV-24176.

1. vcol_fix_expr() generates new tree changes:
Type_std_attributes::agg_item_set_converter() does change_item_tree().

The changes are allocated on expr_arena (via Vcol_expr_context as per
MDEV-24176).

2. vcol_cleanup_expr() doesn't remove these changes (can be a bug of
Type_std_attributes or per design).

3. Atomic CREATE OR REPLACE renames old table to backup
(finalize_atomic_replace()). It does that via
rename_table_and_triggers() and that closes table share and releases
expr_arena root. Hence now we have Item corpses in thd->change_list.

4. PS cleanup phase tries to rollback thd->change_list and accesses
already freed item corpses.

The fix saves and restores change_list on
vcol_fix_expr()/vcol_cleanup_expr().
This commit is contained in:
Aleksey Midenkov
2022-08-31 11:55:05 +03:00
parent 2af15914cb
commit 24fff8267d
4 changed files with 35 additions and 0 deletions

View File

@ -602,6 +602,12 @@ create or replace table t1 (old int);
--error ER_TRG_DOES_NOT_EXIST
show create trigger a;
drop table t1;
--echo # PS: check thd->change_list sanity
create table t1 (a int not null, b char(10) as (concat('', dayname('2020-02-02')))) collate utf8_bin;
prepare stmt from 'insert into t1 (b) values (2)';
create or replace table t1 (x int);
drop table t1;
drop prepare stmt;
--echo # Foreign keys
--list_files $MYSQLD_DATADIR/test *sql*
create table t1 (x int primary key, y int) engine innodb;