| Bug #102339 | Adding Functional Index using ALTER TABLE ALGORITHM=INPLACE produces error | ||
|---|---|---|---|
| Submitted: | 22 Jan 2021 6:02 | Modified: | 22 Jan 2021 13:41 |
| Reporter: | Robert Roland | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: DDL | Severity: | S2 (Serious) |
| Version: | 8.0.23 | OS: | Windows (10 x64) |
| Assigned to: | CPU Architecture: | Other (AMD 3900X) | |
| Tags: | ALGORITHM INPLACE, CONCAT Functional Index, DDL, functional index | ||
[22 Jan 2021 6:02]
Robert Roland
[22 Jan 2021 7:34]
Robert Roland
After additional testing the issue is not always resolved by creating the functional indexes in a particular order. The error may still arise at an unpredictable point after as few as 4 or as many as 7 indexes have been created. This was further tested on another installation of Server 8.0.23 Win 10 x64 Intel i9-9900K 64GB with similar results.
[22 Jan 2021 13:41]
MySQL Verification Team
Hello Robert, Thank you for the report and feedback. regards, Umesh
[22 Jan 2021 13:42]
MySQL Verification Team
-- 8.0.23
mysql> drop table mytable;
Query OK, 0 rows affected (0.05 sec)
mysql> CREATE TABLE `mytable` (
-> `id` int NOT NULL AUTO_INCREMENT,
-> `n1` varchar(30) DEFAULT NULL,
-> `n2` varchar(30) DEFAULT NULL,
-> `n3` varchar(30) DEFAULT NULL,
-> `n4` varchar(30) DEFAULT NULL,
-> `n5` varchar(30) DEFAULT NULL,
-> `n6` varchar(30) DEFAULT NULL,
-> `n7` varchar(30) DEFAULT NULL,
-> `n8` varchar(30) DEFAULT NULL,
-> `n9` varchar(30) DEFAULT NULL,
-> PRIMARY KEY (`id`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
-> ;
Query OK, 0 rows affected (0.06 sec)
mysql> ALTER TABLE mytable ADD INDEX n567((concat(`n5`,`n6`,`n7`))), ALGORITHM=INPLACE, LOCK=SHARED;
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> ALTER TABLE mytable ADD INDEX n12((concat(`n1`, `n2`))), ALGORITHM=INPLACE, LOCK=SHARED;
Query OK, 0 rows affected (0.06 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> ALTER TABLE mytable ADD INDEX n345((concat(`n3`, `n4`, `n5`))), ALGORITHM=INPLACE, LOCK=SHARED;
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> ALTER TABLE mytable ADD INDEX n234((concat(`n2`, `n3`, `n4`))), ALGORITHM=INPLACE, LOCK=SHARED;
ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY.
