fixed testcase.

This commit is contained in:
wenshao
2017-10-22 00:23:35 +08:00
parent 6da6f2281f
commit bcca90972e
@@ -70,24 +70,24 @@ public class MySqlUpdateTest_6 extends MysqlTest {
{
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("SELECT id, user_id, item_id, sku_id, flag, sellable_quantity, fff03, status, feature, feature_lock, version, gmt_create, gmt_modified, root_id, parent_id, dist_type, dist_id, occupy_quantity, user_type"
+ "\nFROM UPDATE COMMIT_ON_SUCCESS ROLLBACK_ON_FAIL TARGET_AFFECT_ROW ? `table_3966`"
+ "\nSET `fff03` = `fff03` + ?, `flag` = `flag` & ~(1 << 10 & ~(1 << 11)), `version` = `version` + 3, `gmt_modified` = NOW()"
+ "\nWHERE `root_id` = ?"
+ "\n\tAND `status` = 1"
+ "\n\tAND `id` IN (?, ?)"
+ "\n\tAND `fff03` + ? >= 0", //
Assert.assertEquals("SELECT id, user_id, item_id, sku_id, flag, sellable_quantity, fff03, status, feature, feature_lock, version, gmt_create, gmt_modified, root_id, parent_id, dist_type, dist_id, occupy_quantity, user_type\n" +
"FROM UPDATE COMMIT_ON_SUCCESS ROLLBACK_ON_FAIL TARGET_AFFECT_ROW ? `table_3966`\n" +
"SET `fff03` = `fff03` + ?, `flag` = `flag` & ~(1 << 10) & ~(1 << 11), `version` = `version` + 3, `gmt_modified` = NOW()\n" +
"WHERE `root_id` = ?\n" +
"\tAND `status` = 1\n" +
"\tAND `id` IN (?, ?)\n" +
"\tAND `fff03` + ? >= 0", //
output);
}
{
String output = SQLUtils.toMySqlString(stmt, SQLUtils.DEFAULT_LCASE_FORMAT_OPTION);
Assert.assertEquals("select id, user_id, item_id, sku_id, flag, sellable_quantity, fff03, status, feature, feature_lock, version, gmt_create, gmt_modified, root_id, parent_id, dist_type, dist_id, occupy_quantity, user_type"
+ "\nfrom update commit_on_success rollback_on_fail target_affect_row ? `table_3966`"
+ "\nset `fff03` = `fff03` + ?, `flag` = `flag` & ~(1 << 10 & ~(1 << 11)), `version` = `version` + 3, `gmt_modified` = NOW()"
+ "\nwhere `root_id` = ?"
+ "\n\tand `status` = 1"
+ "\n\tand `id` in (?, ?)"
+ "\n\tand `fff03` + ? >= 0", //
Assert.assertEquals("select id, user_id, item_id, sku_id, flag, sellable_quantity, fff03, status, feature, feature_lock, version, gmt_create, gmt_modified, root_id, parent_id, dist_type, dist_id, occupy_quantity, user_type\n" +
"from update commit_on_success rollback_on_fail target_affect_row ? `table_3966`\n" +
"set `fff03` = `fff03` + ?, `flag` = `flag` & ~(1 << 10) & ~(1 << 11), `version` = `version` + 3, `gmt_modified` = NOW()\n" +
"where `root_id` = ?\n" +
"\tand `status` = 1\n" +
"\tand `id` in (?, ?)\n" +
"\tand `fff03` + ? >= 0", //
output);
}
}