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

INSTANT algorithm doesn't work with unique HASH index

    XMLWordPrintable

    Details

      Description

      Hello,

      Centos7, mariadb 10.4.7, row_format=Dynamic

      INSTANT algorithm doesn't work if unique HASH index exist in table.

      Also, all tables with unique HASH index have version=11 in 'Show table status'.
      Tables without unique HASH index have version=10 and INSTANT alter work properly

      How to reproduce:
      1) CREATE TABLE `TEST` (
      `ID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
      `MERCHANT_INTERFACE_ID` INT(10) UNSIGNED NOT NULL,
      `ORDER_ID` VARCHAR(50) NOT NULL,

      PRIMARY KEY (`ID`),
      UNIQUE INDEX `PAYMENT_ORDER_ID` (`ORDER_ID`, `MERCHANT_INTERFACE_ID`) USING HASH
      )
      COLLATE='utf8_general_ci'
      ENGINE=InnoDB
      AUTO_INCREMENT=1
      ;
      2) SET SESSION alter_algorithm='INSTANT';
      3) ALTER TABLE `TEST`
      ADD COLUMN `test` INT NULL AFTER `ORDER_ID`;

      /* SQL Error (1846): ALGORITHM=INSTANT is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY */

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              Golubevs Grigorijs
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: