Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.0.17, 10.1.3
-
None
Description
This script:
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1(a INT, b INT);
|
CREATE INDEX i1 ON t1(a) COMMENT 'comment1';
|
ALTER TABLE t1 DROP INDEX i1, ADD INDEX i1(a) COMMENT 'comment2';
|
SHOW CREATE TABLE t1;
|
returns
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| t1 | CREATE TABLE `t1` (
|
`a` int(11) DEFAULT NULL,
|
`b` int(11) DEFAULT NULL,
|
KEY `i1` (`a`) COMMENT 'comment1'
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
Notice, the new comment 'comment2' was ignored. The bug happens when the name and the column list of the new index is exactly the same with the old index.
The expected behaviour would be to replace the comment to 'comment2'.
The problem does not repeat in MariaDB-5.5.
Attachments
Issue Links
- causes
-
MDEV-18266 Changing an index comment unnecessarily rebuilds index
- Closed