Skip to content

Commit a27f0e2

Browse files
authored
[MariaDB] Extended support for MariaDB's ALTER KEY|INDEX (#4427)
1 parent a9c0af4 commit a27f0e2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sql/mariadb/MariaDBParser.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ alterSpecification
743743
| DROP indexFormat = (INDEX | KEY) ifExists? uid # alterByDropIndex // here ifExists is MariaDB-specific only
744744
| RENAME indexFormat = (INDEX | KEY) uid TO uid # alterByRenameIndex
745745
| ALTER INDEX uid (VISIBLE | INVISIBLE) # alterByAlterIndexVisibility
746+
| ALTER (KEY | INDEX) ifExists? uid NOT? IGNORED # alterByAlterIndexIgnore
746747
| DROP FOREIGN KEY ifExists? uid dottedId? # alterByDropForeignKey // here ifExists is MariaDB-specific only
747748
| DISABLE KEYS # alterByDisableKeys
748749
| ENABLE KEYS # alterByEnableKeys

sql/mariadb/examples/fast/ddl_alter.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ alter table add_test add index if not exists ix_add_test_col1 using btree (col1)
3232
alter table add_test add index if not exists ix_add_test_col4 using btree (col4) comment 'test index';
3333
alter table add_test alter index ix_add_test_col1 invisible;
3434
alter table add_test alter index ix_add_test_col1 visible;
35+
alter table add_test alter index if exists ix_add_test_col1 ignored;
36+
alter table add_test alter index ix_add_test_col1 ignored;
37+
alter table add_test alter index ix_add_test_col1 not ignored;
38+
alter table add_test alter key if exists fk ignored;
39+
alter table add_test alter key if exists fk not ignored;
3540
alter table add_test change column if exists col8 col9 tinyint;
3641
alter table add_test change column if exists col3 col5 tinyint;
3742
alter table add_test modify column if exists col9 tinyint;

0 commit comments

Comments
 (0)