mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
mysql parser support alter table
This commit is contained in:
@@ -18,5 +18,14 @@ public class MySqlAlterTableTest1 extends TestCase {
|
||||
String output = SQLUtils.toMySqlString(stmt);
|
||||
Assert.assertEquals("RENAME TABLE t1 TO t2", output);
|
||||
}
|
||||
|
||||
public void test_alter_1() throws Exception {
|
||||
String sql = "ALTER TABLE t2 ADD d TIMESTAMP;";
|
||||
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 COLUMN d TIMESTAMP", output);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user