rename 'MySqlReplicateStatement to MySqlReplaceStatement'

This commit is contained in:
wenshao
2012-07-26 15:29:38 +08:00
parent 165149bf56
commit 440029671c
7 changed files with 28 additions and 17 deletions
@@ -49,6 +49,17 @@ public class REPLACE_Syntax_Test extends TestCase {
Assert.assertEquals("REPLACE DELAYED INTO `online_users` (`session_id`, `user_id`, `page`, `lastview`)\nVALUES ('3580cc4e61117c0785372c426eddd11c', 'XXX', '/', NOW());",
text);
}
public void test_2() throws Exception {
String sql = " replace into t(col1,col2)values(?,?)";
SQLStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> stmtList = parser.parseStatementList();
String text = output(stmtList);
Assert.assertEquals("REPLACE INTO t (col1, col2)\nVALUES (?, ?);", text);
}
private String output(List<SQLStatement> stmtList) {
StringBuilder out = new StringBuilder();