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

DROP COLUMN, DROP INDEX is wrongly claimed to be ALGORITHM=INSTANT

    XMLWordPrintable

    Details

      Description

      The following SQL test case works on 10.3 but fails to return an error on 10.4:

      --source include/have_innodb.inc
      CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=InnoDB;
      --error ER_ALTER_OPERATION_NOT_SUPPORTED
      ALTER TABLE t1 DROP b, ALGORITHM=INSTANT;
      DROP TABLE t1;
      

      The reason appears to be a code change that was part of MDEV-15563:

      @@ -2003,9 +2040,7 @@ ha_innobase::check_if_supported_inplace_alter(
       		af++;
       	}
       
      -	if (supports_instant
      -	    || !(ha_alter_info->handler_flags
      -		 & ~(INNOBASE_ALTER_INSTANT | INNOBASE_INPLACE_IGNORE))) {
      +	if (supports_instant) {
       		DBUG_RETURN(HA_ALTER_INPLACE_INSTANT);
       	}
       
      

      We should not return HA_ALTER_INPLACE_INSTANT if any flags in INNOBASE_ALTER_NOREBUILD (dropping or creating secondary indexes) are set, because those are not instantaneous operations.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: