Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
1) MySQL 5.7 has RENAME INDEX, MariaDB should, too.
http://dev.mysql.com/doc/refman/5.7/en/alter-table.html
"RENAME INDEX old_index_name TO new_index_name" renames an index.
2) My permute-index tool creates synthetic index names that need to be renamed later for esthetic reasons (ie. idx_jb_007.)
Attachments
Issue Links
- causes
-
MDEV-23356 InnoDB: Failing assertion: field->col->mtype == type, crash or ASAN failures in row_sel_convert_mysql_key_to_innobase, InnoDB indexes are inconsistent after INDEX changes
-
- Closed
-
-
MDEV-25555 Server crashes in tree_record_pos after INPLACE-recreating index on HEAP table
-
- Closed
-
- duplicates
-
MDEV-18196 ALTER TABLE RENAME INDEX
-
- Closed
-
- relates to
-
MDEV-13301 Optimize DROP INDEX, ADD INDEX into RENAME INDEX
-
- Closed
-
-
MDEV-16290 ALTER TABLE ... RENAME COLUMN syntax
-
- Closed
-
-
MDEV-21889 IF EXISTS clause does not work for RENAME COLUMN and RENAME INDEX
-
- Closed
-
-
MDEV-25803 Inplace ALTER breaks MyISAM/Aria table when order of keys is changed
-
- Closed
-
For what it is worth, I would always have liked ALTER TABLE…RENAME COLUMN syntax when I implemented the InnoDB counterparts of MySQL WL#5534 (ALTER TABLE…ALGORITHM=INPLACE) in MySQL 5.6. Currently the way to rename columns is error-prone, because you will have to specify the old type and ⟦NOT⟧ NULL of the column. Make a subtle mistake, and you will be punished with ALGORITHM=COPY that will convert the column data type.
MySQL 5.7 introduced RENAME INDEX syntax, but no RENAME COLUMN.
That said, I think that it should be technically possible to rename an index by specifying DROP INDEX old_name, ADD INDEX new_name(old_index_column). In practice, InnoDB would unnecessarily drop and create an index, even though only the name is changing.