mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-22881 Unexpected errors, corrupt output, Valgrind / ASAN errors in Item_ident::print or append_identifier
After this code end_inplace: if (thd->locked_tables_list.reopen_tables(thd, false)) goto err_with_mdl_after_alter; table is not reopened (need_reopen is false) but some_table_marked_for_reopen is reset to false. Item_field is allocated on table lock and assigned new name on first ALTER which is then freed at the end of the command. Second ALTER accessess this Item_field and gets garbage value.
This commit is contained in:
@@ -2517,6 +2517,18 @@ alter table if exists t1 rename t2;
|
||||
show create table t2;
|
||||
drop table t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-22881 Unexpected errors, corrupt output, Valgrind / ASAN errors in Item_ident::print or append_identifier
|
||||
--echo #
|
||||
create table t1 (a int check (a >= 0));
|
||||
lock tables t1 write;
|
||||
alter table t1 rename column a to a;
|
||||
alter table t1 rename key if exists x to xx;
|
||||
|
||||
# cleanup
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user