diff --git a/debezium-ddl-parser/src/main/antlr4/io/debezium/ddl/parser/mysql/generated/MySqlParser.g4 b/debezium-ddl-parser/src/main/antlr4/io/debezium/ddl/parser/mysql/generated/MySqlParser.g4 index a8eba032f..51fd196e9 100644 --- a/debezium-ddl-parser/src/main/antlr4/io/debezium/ddl/parser/mysql/generated/MySqlParser.g4 +++ b/debezium-ddl-parser/src/main/antlr4/io/debezium/ddl/parser/mysql/generated/MySqlParser.g4 @@ -622,6 +622,7 @@ alterSpecification | MODIFY COLUMN? ifExists? uid columnDefinition (FIRST | AFTER uid)? #alterByModifyColumn // ifExists is MariaDB-specific | DROP COLUMN? ifExists? uid RESTRICT? #alterByDropColumn // ifExists is MariaDB-specific + | DROP (CONSTRAINT | CHECK) uid #alterByDropConstraintCheck | DROP PRIMARY KEY #alterByDropPrimaryKey | DROP indexFormat=(INDEX | KEY) ifExists? uid #alterByDropIndex | RENAME indexFormat=(INDEX | KEY) uid TO uid #alterByRenameIndex diff --git a/debezium-ddl-parser/src/test/resources/mysql/examples/ddl_alter.sql b/debezium-ddl-parser/src/test/resources/mysql/examples/ddl_alter.sql index 3577c999e..a4141879e 100644 --- a/debezium-ddl-parser/src/test/resources/mysql/examples/ddl_alter.sql +++ b/debezium-ddl-parser/src/test/resources/mysql/examples/ddl_alter.sql @@ -4,6 +4,7 @@ alter table ship_class add column ship_spec varchar(150) first, add somecol int alter table t3 add column (c2 decimal(10, 2) comment 'comment`' null, c3 enum('abc', 'cba', 'aaa')), add index t3_i1 using btree (c2) comment 'some index'; alter table t3 add column (c4 decimal(10, 2) comment 'comment`' null), add index t3_i2 using btree (c4) comment 'some index'; alter table t2 add constraint t2_pk_constraint primary key (1c), alter column `_` set default 1; +alter table t2 drop constraint t2_pk_constraint; alter table ship_class change column somecol col_for_del tinyint first; alter table ship_class drop col_for_del; alter table t3 drop index t3_i1; @@ -100,4 +101,4 @@ alter user 'user'@'%' identified with 'mysql_native_password' as '*2470C0C06DEE4 require none password expire default account unlock password_lock_time 2; alter user 'user'@'%' identified with 'mysql_native_password' as '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' require none password expire default account unlock password_lock_time unbounded; -#end \ No newline at end of file +#end