Commit 1893a137 authored by Thirunarayanan Balathandayuthapani's avatar Thirunarayanan Balathandayuthapani Committed by Marko Mäkelä

MDEV-22633 Assertion failed in prepare_inplace_alter_table_dict

prepare_inplace_alter_table_dict(): In the error handling, relax
a debug assertion for the case that we did not execute
dict_stats_wait_bg_to_stop_using_table() yet.
parent d2900d91
......@@ -4404,6 +4404,7 @@ prepare_inplace_alter_table_dict(
create_table_info_t info(ctx->prebuilt->trx->mysql_thd, altered_table,
ha_alter_info->create_info, NULL, NULL,
srv_file_per_table);
ut_d(bool stats_wait = false);
if (num_fts_index > 1) {
my_error(ER_INNODB_FT_LIMIT, MYF(0));
......@@ -4477,6 +4478,7 @@ prepare_inplace_alter_table_dict(
XXX what may happen if bg stats opens the table after we
have unlocked data dictionary below? */
dict_stats_wait_bg_to_stop_using_table(user_table, ctx->trx);
ut_d(stats_wait = true);
online_retry_drop_indexes_low(ctx->new_table, ctx->trx);
......@@ -5116,7 +5118,8 @@ prepare_inplace_alter_table_dict(
/* n_ref_count must be 1, because purge cannot
be executing on this very table as we are
holding dict_operation_lock X-latch. */
DBUG_ASSERT(user_table->get_ref_count() == 1 || ctx->online);
ut_ad(!stats_wait || ctx->online
|| user_table->get_ref_count() == 1);
online_retry_drop_indexes_with_trx(user_table, ctx->trx);
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment