sharding support

This commit is contained in:
wenshao
2012-11-25 19:51:43 +08:00
parent 021126367c
commit 0c0bdc5f55
6 changed files with 246 additions and 31 deletions
@@ -56,7 +56,7 @@ public class DMLDeleteParserTest extends TestCase {
Assert.assertEquals("DELETE FROM offer.*, wp_image.*\n" + //
"USING offer a, wp_image b\n" + //
"WHERE a.member_id = b.member_id\n" + //
"AND a.member_id = 'abc'", output);
"\tAND a.member_id = 'abc'", output);
}
public void testDelete_3() throws Exception {
@@ -91,7 +91,7 @@ public class DMLDeleteParserTest extends TestCase {
Assert.assertEquals("DELETE id.*\n" + //
"FROM t1, t2\n" + //
"WHERE col1 = 'adf'\n" + //
"AND col2 = 1", output);
"\tAND col2 = 1", output);
}
public void testDelete_6() throws Exception {
@@ -41,7 +41,7 @@ public class MySqlParameterizedOutputVisitorTest extends TestCase {
validateOracle("SELECT * FROM T WHERE A.ID = ? OR A.ID = ?", "SELECT *\nFROM T\nWHERE A.ID = ?");
validate("INSERT INTO T (F1, F2) VALUES(?, ?), (?, ?), (?, ?)", "INSERT INTO T (F1, F2) VALUES (?, ?)");
validate("update net_device d, sys_user u set d.resp_user_id=u.id where d.resp_user_login_name=u.username and d.id in (42354)", //
"UPDATE net_device d, sys_user u\nSET d.resp_user_id = u.id\nWHERE d.resp_user_login_name = u.username\nAND d.id IN (?)");
"UPDATE net_device d, sys_user u\nSET d.resp_user_id = u.id\nWHERE d.resp_user_login_name = u.username\n\tAND d.id IN (?)");
// System.out.println("SELECT * FORM A WHERE ID = (##)".replaceAll("##", "?"));
}