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

tables with UNIQUE blob columns cannot be alter_algorithm=INSTANT modified

    XMLWordPrintable

Details

    Description

      create table test (t text,  unique index i(t));
      ALTER TABLE test  ADD COLUMN test INT NULL AFTER t;
      ERROR 1846 (0A000): ALGORITHM=INSTANT is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY
      

      While the unique index i doesn't take place in the later, it does prevent it from instantly happening.

      Early in the alter_table processing compare_keys_but_name compares the existing table key and the table keys in the new structure, and determines they are different.

      This is because:

      • the table_key got treated by re_setup_keyinfo_hash and had HA_NOSAME stripped from the table_key->flags.
      • comparing further down in the same function, the comparsion of parts fails as the new_part->field and fields aren't populated.

      This results in the ALTER TABLE considering the index to be different, and not allowing the ALGORITHM=INSTANT later.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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