Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.6
-
None
Description
The new sub-command ALTER TABLE .. ALTER INDEX, added within the scope of MDEV-7317 (Ignored indexes), is inconsistent with its sibling sub-commands.
ALTER doesn't accept KEY as a synonym for INDEX, while ADD/DROP/RENAME do :
10.6 03ff588d1 |
MariaDB [test]> alter table t drop key a; |
Query OK, 0 rows affected (0.023 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> alter table t add key a(a); |
Query OK, 0 rows affected (0.061 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> alter table t alter key a ignore; |
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key a ignore' at line 1 |
ALTER doesn't accept IF EXISTS clause, while DROP/RENAME do, and ADD accepts IF NOT EXISTS:
MariaDB [test]> alter table t drop index if exists b; |
Query OK, 0 rows affected, 1 warning (0.001 sec) |
Records: 0 Duplicates: 0 Warnings: 1
|
|
MariaDB [test]> alter table t alter index if exists b ignore; |
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'if exists b ignore' at line 1 |