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

ALTER TABLE…ALGORITHM=DEFAULT does not override alter_algorithm

    XMLWordPrintable

    Details

      Description

      Even if ALGORITHM=DEFAULT is explicitly specified in ALTER TABLE, the variable alter_algorithm will be substituted. That variable should only be substituted when no ALGORITHM has been specified.

      --source include/have_innodb.inc
      CREATE TABLE t(id INT PRIMARY KEY, u INT UNSIGNED NOT NULL UNIQUE)
      ENGINE=InnoDB;
      INSERT INTO t(id,u) VALUES(1,1),(2,2),(3,3);
       
      SET alter_algorithm=instant;
      ALTER TABLE t ADD COLUMN d DATETIME DEFAULT current_timestamp();
      --error ER_ALTER_OPERATION_NOT_SUPPORTED
      ALTER TABLE t DROP COLUMN u;
      --error ER_ALTER_OPERATION_NOT_SUPPORTED
      ALTER TABLE t DROP COLUMN u, ALGORITHM=NOCOPY;
      # this should succeed, but currently fails!
      ALTER TABLE t DROP COLUMN u, ALGORITHM=DEFAULT;
      DROP TABLE t;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thiru Thirunarayanan Balathandayuthapani
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: