mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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.
This commit is contained in:
@ -6558,7 +6558,7 @@ static void alter_partition_lock_handling(ALTER_PARTITION_PARAM_TYPE *lpt)
|
||||
thd->set_stmt_da(&tmp_stmt_da);
|
||||
}
|
||||
|
||||
if (thd->locked_tables_list.reopen_tables(thd))
|
||||
if (thd->locked_tables_list.reopen_tables(thd, false))
|
||||
sql_print_warning("We failed to reacquire LOCKs in ALTER TABLE");
|
||||
|
||||
if (stmt_da)
|
||||
@ -6762,7 +6762,7 @@ err_exclusive_lock:
|
||||
thd->set_stmt_da(&tmp_stmt_da);
|
||||
}
|
||||
|
||||
if (thd->locked_tables_list.reopen_tables(thd))
|
||||
if (thd->locked_tables_list.reopen_tables(thd, false))
|
||||
sql_print_warning("We failed to reacquire LOCKs in ALTER TABLE");
|
||||
|
||||
if (stmt_da)
|
||||
|
Reference in New Issue
Block a user