improved mysql parser Kill_Statement support. issue #1326

This commit is contained in:
wenshao
2016-07-13 09:32:12 +08:00
parent f526bf5943
commit 11ff35f4ae
5 changed files with 42 additions and 11 deletions
@@ -48,7 +48,27 @@ public class Kill_Test extends TestCase {
Assert.assertEquals("KILL CONNECTION 233;", text);
}
public void test_2() throws Exception {
String sql = "KILL 233";
MySqlStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("KILL 233;", text);
}
public void test_3() throws Exception {
String sql = "KILL 233,234";
MySqlStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("KILL 233, 234;", text);
}
private String output(List<SQLStatement> stmtList) {
StringBuilder out = new StringBuilder();