Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7390

[PATCH] alter online table xxxx (no options) should be possible

Details

    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.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment - - edited

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

            danblack Daniel Black added a comment - - edited since handle_if_exists_options only removes alter_info->flags if the exists {column, fk,partition etc} exists, lets short cut that too.
            danblack Daniel Black added a comment - https://github.com/MariaDB/server/pull/23
            serg Sergei Golubchik added a comment - for 10.0: https://github.com/MariaDB/server/pull/58

            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?

            serg Sergei Golubchik added a comment - 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?
            danblack Daniel Black added a comment -

            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.

            danblack Daniel Black added a comment - 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.
            danblack Daniel Black added a comment -

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

            danblack Daniel Black added a comment - the if condition before handle_if_exists_options is an optional part of the patch. Omit if you feel uncomfortable about it.

            People

              serg Sergei Golubchik
              danblack Daniel Black
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.