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;