[MDEV-7390] [PATCH] alter online table xxxx (no options) should be possible Created: 2014-12-29  Updated: 2015-05-03  Resolved: 2015-05-03

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: 10.0.15
Fix Version/s: 10.0.18

Type: Bug Priority: Major
Reporter: Daniel Black Assignee: Sergei Golubchik
Resolution: Fixed Votes: 1
Labels: None

Attachments: File alter-noop-2.patch    

 Description   

alter online table t1 algorithm=INPLACE, lock=NONE;

sure it does nothing, but the current implementation does a full table copy for it.

simple patch for a simple problem.



 Comments   
Comment by Daniel Black [ 2014-12-29 ]

since handle_if_exists_options only removes alter_info->flags if the exists {column, fk,partition etc} exists, lets short cut that too.

Comment by Daniel Black [ 2015-03-11 ]

https://github.com/MariaDB/server/pull/23

Comment by Sergei Golubchik [ 2015-05-01 ]

for 10.0: https://github.com/MariaDB/server/pull/58

Comment by Sergei Golubchik [ 2015-05-01 ]

danblack, I don't understand your comment about handle_if_exists_options (and the if() you've added above it). Could you please elaborate on that?

Comment by Daniel Black [ 2015-05-01 ]

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.

Comment by Daniel Black [ 2015-05-01 ]

the if condition before handle_if_exists_options is an optional part of the patch. Omit if you feel uncomfortable about it.

Generated at Thu Feb 08 07:19:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.