Commit a33c0e3f authored by Marko Mäkelä's avatar Marko Mäkelä

Minor clean-up for MDEV-17038

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.
parent 4acfc6ec
...@@ -869,12 +869,9 @@ ha_innobase::check_if_supported_inplace_alter( ...@@ -869,12 +869,9 @@ ha_innobase::check_if_supported_inplace_alter(
{ {
DBUG_ENTER("check_if_supported_inplace_alter"); DBUG_ENTER("check_if_supported_inplace_alter");
const bool need_rebuild = innobase_need_rebuild(ha_alter_info, table); if ((ha_alter_info->handler_flags
& INNOBASE_ALTER_VERSIONED_REBUILD)
if (need_rebuild && altered_table->versioned(VERS_TIMESTAMP)) {
&& altered_table->versioned(VERS_TIMESTAMP)
&& (ha_alter_info->handler_flags
& INNOBASE_ALTER_VERSIONED_REBUILD)) {
ha_alter_info->unsupported_reason = ha_alter_info->unsupported_reason =
"Not implemented for system-versioned timestamp tables"; "Not implemented for system-versioned timestamp tables";
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
...@@ -1312,7 +1309,8 @@ ha_innobase::check_if_supported_inplace_alter( ...@@ -1312,7 +1309,8 @@ ha_innobase::check_if_supported_inplace_alter(
DBUG_RETURN(HA_ALTER_INPLACE_INSTANT); 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) { if (!online) {
/* We already determined that only a non-locking /* We already determined that only a non-locking
......
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