Skip to content

Commit

Permalink
MDEV-22633 Assertion failed in prepare_inplace_alter_table_dict
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Thirunarayanan authored and dr-m committed May 20, 2020
1 parent d2900d9 commit 1893a13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion storage/innobase/handler/handler0alter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1893a13

Please sign in to comment.