Bug #97058 How to change the index type with ALGORITHM=INSTANT
Submitted: 29 Sep 2019 15:13 Modified: 30 Sep 2019 14:11
Reporter: Matt Zand Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S7 (Test Cases)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[29 Sep 2019 15:13] Matt Zand
Description:
I can not change the index type with ALGORITHM=INSTANT. In the document, we can change the index type with ALGORITHM=INSTANT.

https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html

Is this document bug?

8.0.13>show create table test3.sbtest1\G
*************************** 1. row ***************************
       Table: sbtest1
Create Table: CREATE TABLE `sbtest1` (
  `pk` int(9) NOT NULL AUTO_INCREMENT,
  `k` int(10) NOT NULL DEFAULT '0',
  `c` char(220) NOT NULL DEFAULT '',
  `pad` char(60) NOT NULL DEFAULT '',
  `c1` enum('a','b','c','d') DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `k_1` (`k`),
  KEY `cidx` (`c`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)

8.0.13>
8.0.13>ALTER TABLE test3.sbtest1 DROP INDEX cidx,ADD INDEX cidx(c,pad) USING BTREE, ALGORITHM=INSTANT;
ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY/INPLACE.
8.0.13>
8.0.13>

Thx,

Matt
https://coding-bootcamps.com/
https://myhsts.org/
https://dcwebmakers.com/

How to repeat:
Testcase

CREATE TABLE `sbtest1` (
  `pk` int(9) NOT NULL AUTO_INCREMENT,
  `k` int(10) NOT NULL DEFAULT '0',
  `c` char(220) NOT NULL DEFAULT '',
  `pad` char(60) NOT NULL DEFAULT '',
  `c1` enum('a','b','c','d') DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `k_1` (`k`),
  KEY `cidx` (`c`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

ALTER TABLE test3.sbtest1 DROP INDEX cidx,ADD INDEX cidx(c,pad) USING BTREE, ALGORITHM=INSTANT;
[30 Sep 2019 14:11] MySQL Verification Team
Hi Mr. Zand,

Thank you for your bug report.

However, this is not a bug.

Our 8.0 Reference Manual in the chapter 15.12.1 explains what is possible and what is not possible.

Not a bug.