DBZ-1329 Support for rename index
This commit is contained in:
parent
72b751b528
commit
e2f2c88952
@ -1610,6 +1610,20 @@ public void shouldParseAlterTableWithDropIndex() {
|
||||
listener.forEach(this::printEvent);
|
||||
}
|
||||
|
||||
@Test
|
||||
@FixFor("DBZ-1329")
|
||||
public void shouldParseAlterTableWithIndex() {
|
||||
final String ddl = "USE db;"
|
||||
+ "CREATE TABLE db.t1 (ID INTEGER PRIMARY KEY, val INTEGER, INDEX myidx(val));"
|
||||
+ "ALTER TABLE db.t1 RENAME INDEX myidx to myidx2;";
|
||||
parser = new MysqlDdlParserWithSimpleTestListener(listener, true);
|
||||
parser.parse(ddl, tables);
|
||||
assertThat(tables.size()).isEqualTo(1);
|
||||
final Table table = tables.forTable(new TableId(null, "db", "t1"));
|
||||
assertThat(table).isNotNull();
|
||||
assertThat(table.columns()).hasSize(2);
|
||||
}
|
||||
|
||||
@FixFor("DBZ-437")
|
||||
@Test
|
||||
public void shouldParseStringSameAsKeyword() {
|
||||
|
@ -618,6 +618,7 @@ alterSpecification
|
||||
| DROP COLUMN? uid RESTRICT? #alterByDropColumn
|
||||
| DROP PRIMARY KEY #alterByDropPrimaryKey
|
||||
| DROP indexFormat=(INDEX | KEY) uid #alterByDropIndex
|
||||
| RENAME indexFormat=(INDEX | KEY) uid TO uid #alterByRenameIndex
|
||||
| DROP FOREIGN KEY uid #alterByDropForeignKey
|
||||
| DISABLE KEYS #alterByDisableKeys
|
||||
| ENABLE KEYS #alterByEnableKeys
|
||||
|
Loading…
Reference in New Issue
Block a user