1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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:
Aleksey Midenkov
2020-06-15 19:10:39 +03:00
parent 359d5f56c3
commit 30d41c8102
3 changed files with 25 additions and 1 deletions

View File

@ -2592,7 +2592,8 @@ Locked_tables_list::reopen_tables(THD *thd, bool need_reopen)
/* Reset flag that some table was marked for reopen */
some_table_marked_for_reopen= 0;
if (need_reopen)
some_table_marked_for_reopen= 0;
for (TABLE_LIST *table_list= m_locked_tables;
table_list; table_list= table_list->next_global)