Skip to content

Commit

Permalink
Cleanup: Remove redundant conditions
Browse files Browse the repository at this point in the history
ha_innobase::prepare_inplace_alter_table(): Remove always-true conditions.
Near the start of the function, we would already have returned if
no ALTER TABLE operation flags were set that would require special
action from InnoDB.

It turns out that the conditions were redundant already when they were
introduced in mysql/mysql-server@241387a
and in commit 068c619.

Thanks to Nikita Malyavin for noticing this.
  • Loading branch information
dr-m committed Jul 29, 2021
1 parent 9b8e207 commit 0e8981e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions storage/innobase/handler/handler0alter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5506,11 +5506,7 @@ ha_innobase::prepare_inplace_alter_table(
ha_alter_info->key_count)) {
err_exit_no_heap:
DBUG_ASSERT(m_prebuilt->trx->dict_operation_lock_mode == 0);
if (ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) {

online_retry_drop_indexes(
m_prebuilt->table, m_user_thd);
}
online_retry_drop_indexes(m_prebuilt->table, m_user_thd);
DBUG_RETURN(true);
}

Expand Down Expand Up @@ -5969,12 +5965,7 @@ ha_innobase::prepare_inplace_alter_table(
}

DBUG_ASSERT(m_prebuilt->trx->dict_operation_lock_mode == 0);
if (ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) {

online_retry_drop_indexes(
m_prebuilt->table, m_user_thd);

}
online_retry_drop_indexes(m_prebuilt->table, m_user_thd);

if ((ha_alter_info->handler_flags
& Alter_inplace_info::DROP_VIRTUAL_COLUMN)
Expand Down

0 comments on commit 0e8981e

Please sign in to comment.