summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-04-20 10:10:33 +0200
committerSergei Golubchik <serg@mariadb.org>2018-04-20 10:24:44 +0200
commitbcb36ee21e2515d17dcf03b760487e64eb780f2b (patch)
treee951c3fc19c732b9f88dac31ff06254ebffb2778 /sql/sql_admin.cc
parent86718fda4e5363b05aa2beaac596ec614aaa7a0f (diff)
downloadmariadb-git-bcb36ee21e2515d17dcf03b760487e64eb780f2b.tar.gz
MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION
ALTER TABLE ... ADD PARTITION modifies the open TABLE structure, and sets table->need_reopen=1 to reset these modifications in case of an error. But under LOCK TABLES the table isn't get reopened, despite need_reopen. Fixed by reopening need_reopen tables under LOCK TABLE.
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 3aac41d6e41..6ba6f8a912e 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -238,7 +238,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
if (thd->locked_tables_list.locked_tables())
{
- if (thd->locked_tables_list.reopen_tables(thd))
+ if (thd->locked_tables_list.reopen_tables(thd, false))
goto end;
/* Restore the table in the table list with the new opened table */
table_list->table= pos_in_locked_tables->table;