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

MDEV-18154 Deadlock and assertion upon no-op ALTER under LOCK TABLES

1. Revert incorrect treatment of m_needs_reopen;
2. Close single instance of TABLE instead of all instances since
   reopened only those that are marked for reopen.
This commit is contained in:
Aleksey Midenkov
2019-08-15 22:32:59 +03:00
parent 395e1dcd17
commit 1639873671
2 changed files with 10 additions and 6 deletions

View File

@ -7831,7 +7831,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
Create_field *def;
Field **f_ptr,*field;
MY_BITMAP *dropped_fields= NULL; // if it's NULL - no dropped fields
bool save_reopen= table->m_needs_reopen;
DBUG_ENTER("mysql_prepare_alter_table");
/*
@ -8511,9 +8510,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
alter_info->create_list.swap(new_create_list);
alter_info->key_list.swap(new_key_list);
alter_info->check_constraint_list.swap(new_constraint_list);
DBUG_RETURN(rc);
err:
table->m_needs_reopen= save_reopen;
DBUG_RETURN(rc);
}