Skip to content

Commit

Permalink
Minor clean-up for MDEV-17038
Browse files Browse the repository at this point in the history
ha_innobase::check_if_supported_inplace_alter(): Remove a redundant
condition and defer some computations.

If INNOBASE_ALTER_VERSIONED_REBUILD is set, innobase_need_rebuild()
will necessarily hold. Therefore, it is not necessary to assign
need_rebuild at the start of the function.
  • Loading branch information
dr-m committed Nov 1, 2018
1 parent 4acfc6e commit a33c0e3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions storage/innobase/handler/handler0alter.cc
Expand Up @@ -869,12 +869,9 @@ ha_innobase::check_if_supported_inplace_alter(
{
DBUG_ENTER("check_if_supported_inplace_alter");

const bool need_rebuild = innobase_need_rebuild(ha_alter_info, table);

if (need_rebuild
&& altered_table->versioned(VERS_TIMESTAMP)
&& (ha_alter_info->handler_flags
& INNOBASE_ALTER_VERSIONED_REBUILD)) {
if ((ha_alter_info->handler_flags
& INNOBASE_ALTER_VERSIONED_REBUILD)
&& altered_table->versioned(VERS_TIMESTAMP)) {
ha_alter_info->unsupported_reason =
"Not implemented for system-versioned timestamp tables";
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
Expand Down Expand Up @@ -1312,7 +1309,8 @@ ha_innobase::check_if_supported_inplace_alter(
DBUG_RETURN(HA_ALTER_INPLACE_INSTANT);
}

bool fts_need_rebuild = false;
bool fts_need_rebuild = false;
const bool need_rebuild = innobase_need_rebuild(ha_alter_info, table);

if (!online) {
/* We already determined that only a non-locking
Expand Down

0 comments on commit a33c0e3

Please sign in to comment.