Skip to content

Commit

Permalink
DROP index if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
osheroff committed Mar 24, 2024
1 parent 794cddd commit ee2330a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/antlr4/imports/mysql_alter_table.g4
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ignored_alter_specifications:
ADD index_definition
| ALTER INDEX name (VISIBLE | INVISIBLE)
| ALTER COLUMN? name ((SET DEFAULT literal) | (DROP DEFAULT) | (SET (VISIBLE | INVISIBLE)))
| DROP INDEX index_name
| DROP INDEX if_exists? index_name
| DISABLE KEYS
| ENABLE KEYS
| ORDER BY alter_ordering (',' alter_ordering)*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ public void testParsingSomeAlters() {
"CREATE TABLE employees (data JSON, INDEX idx ((CAST(data->>'$.name' AS CHAR(30)) COLLATE utf8mb4_bin)))",
"ALTER TABLE tasks DROP COLUMN IF EXISTS snoozed_until",
"ALTER TABLE outgoing_notifications_log ADD INDEX idx_campaign_updated (campaign, last_updated_at) ALGORITHM=NOCOPY,LOCK=NONE",
"alter table test.c ALGORITHM=COPY, STATS_SAMPLE_PAGES=DEFAULT"
"alter table test.c ALGORITHM=COPY, STATS_SAMPLE_PAGES=DEFAULT",
"ALTER TABLE vehicles " +
"DROP INDEX IF EXISTS uq_vehicles_oem_id_oem_vin," +
"ALGORITHM=NOCOPY, LOCK=NONE"

};

for ( String s : testSQL ) {
Expand Down

0 comments on commit ee2330a

Please sign in to comment.