mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
mysql parser alter table support
This commit is contained in:
@@ -27,5 +27,14 @@ public class MySqlAlterTableTest1 extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("ALTER TABLE t2\n\tADD COLUMN d TIMESTAMP", output);
|
||||
}
|
||||
|
||||
public void test_alter_2() throws Exception {
|
||||
String sql = "ALTER TABLE t2 ADD INDEX (d), ADD UNIQUE (a);";
|
||||
MySqlStatementParser parser = new MySqlStatementParser(sql);
|
||||
SQLStatement stmt = parser.parseStatementList().get(0);
|
||||
parser.match(Token.EOF);
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("ALTER TABLE t2\n\tADD INDEX (d),\n\tADD UNIQUE (a)", output);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user