This if statement is considering whether to allow online operations based on the flags. When Alter_info::ALTER_RENAME or Alter_info::ALTER_KEYS_ONOFF is specified we can still do it online so lets mask those out.
alter_info->flags & ~(Alter_info::ALTER_RENAME |Alter_info::ALTER_KEYS_ONOFF would normally be true if we've got some flags incompatible with with online operations.
if (!(alter_info->flags & ~(Alter_info::ALTER_RENAME |
|
Alter_info::ALTER_KEYS_ONOFF))
|
alter_info->flags != 0 is added because if no flags (i.e. a plain alter online table xxxx) is specified this above condition is also false resulting in no online being possible.
The only outcome of handle_if_exists is that alter_info->flags&=
{something}
under various branches. If alter_info->flags is already 0 we don't need to call this function.
since handle_if_exists_options only removes alter_info->flags if the exists {column, fk,partition etc} exists, lets short cut that too.