mysql parser ddl support

This commit is contained in:
温少
2012-05-16 20:06:15 +08:00
parent f8ce34bd93
commit 23e770e13b
8 changed files with 45 additions and 11 deletions
@@ -189,6 +189,15 @@ public class DDLParserTest extends TestCase {
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("RENAME TABLE current_db.tbl_name TO other_db.tbl_name", output);
}
public void test_rename_1() throws Exception {
String sql = "rename table tb1 to ntb1,tb2 to ntb2";
MySqlStatementParser parser = new MySqlStatementParser(sql);
SQLStatement stmt = parser.parseStatementList().get(0);
parser.match(Token.EOF);
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("RENAME TABLE tb1 TO ntb1, tb2 TO ntb2", output);
}
// public void testDDLStmt() throws Exception {