Skip to content

Commit

Permalink
fix DrdsTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
junwen12221 committed Nov 20, 2021
1 parent 2841357 commit 5fac637
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internalexample/src/test/java/io.mycat.drdsrunner/DrdsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public static DrdsSqlCompiler getDrds() {
"\t\t\t\t\t\"dbNum\":\"2\",\n" +
"\t\t\t\t\t\"mappingFormat\":\"c${targetIndex}/db1_${dbIndex}/sharding_${tableIndex}\",\n" +
"\t\t\t\t\t\"tableNum\":\"2\",\n" +
"\t\t\t\t\t\"tableMethod\":\"hash(id)\",\n" +
"\t\t\t\t\t\"tableMethod\":\"mod_hash(id)\",\n" +
"\t\t\t\t\t\"storeNum\":2,\n" +
"\t\t\t\t\t\"dbMethod\":\"hash(id)\"\n" +
"\t\t\t\t\t\"dbMethod\":\"mod_hash(id)\"\n" +
"\t\t\t\t}", Map.class)).build());
logicSchemaConfig.getShardingTables().put("sharding", mainSharding);

Expand All @@ -122,9 +122,9 @@ public static DrdsSqlCompiler getDrds() {
"\t\t\t\t\t\"dbNum\":\"2\",\n" +
"\t\t\t\t\t\"mappingFormat\":\"c${targetIndex}/db1_${dbIndex}/er_${tableIndex}\",\n" +
"\t\t\t\t\t\"tableNum\":\"2\",\n" +
"\t\t\t\t\t\"tableMethod\":\"hash(id)\",\n" +
"\t\t\t\t\t\"tableMethod\":\"mod_hash(id)\",\n" +
"\t\t\t\t\t\"storeNum\":2,\n" +
"\t\t\t\t\t\"dbMethod\":\"hash(id)\"\n" +
"\t\t\t\t\t\"dbMethod\":\"mod_hash(id)\"\n" +
"\t\t\t\t}", Map.class)).build());
logicSchemaConfig.getShardingTables().put("er", er);

Expand All @@ -139,14 +139,14 @@ public static DrdsSqlCompiler getDrds() {
" PRIMARY KEY (`id`),\n" +
" KEY `id` (`id`)\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8"
+ " dbpartition by mod_hash(id) tbpartition by mod_hash(id) tbpartitions 2 dbpartitions 2;");
+ " dbpartition by mod_hash(id) tbpartition by UNI_HASH(id) tbpartitions 2 dbpartitions 2;");
other_sharding.setFunction(ShardingFunction.builder().properties(JsonUtil.from("{\n" +
"\t\t\t\t\t\"dbNum\":\"2\",\n" +
"\t\t\t\t\t\"mappingFormat\":\"c${targetIndex}/db1_${dbIndex}/other_sharding_${tableIndex}\",\n" +
"\t\t\t\t\t\"tableNum\":\"2\",\n" +
"\t\t\t\t\t\"tableMethod\":\"UNI_HASH(id)\",\n" +
"\t\t\t\t\t\"storeNum\":2,\n" +
"\t\t\t\t\t\"dbMethod\":\"hash(id)\"\n" +
"\t\t\t\t\t\"dbMethod\":\"mod_hash(id)\"\n" +
"\t\t\t\t}", Map.class)).build());
logicSchemaConfig.getShardingTables().put("other_sharding", other_sharding);

Expand Down Expand Up @@ -186,9 +186,9 @@ public static DrdsSqlCompiler getDrds() {
"\t\t\t\t\t\"dbNum\":\"2\",\n" +
"\t\t\t\t\t\"mappingFormat\":\"c${targetIndex}/db1_${dbIndex}/sharding_${index}\",\n" +
"\t\t\t\t\t\"tableNum\":\"2\",\n" +
"\t\t\t\t\t\"tableMethod\":\"hash(id)\",\n" +
"\t\t\t\t\t\"tableMethod\":\"mod_hash(id)\",\n" +
"\t\t\t\t\t\"storeNum\":2,\n" +
"\t\t\t\t\t\"dbMethod\":\"hash(id)\"\n" +
"\t\t\t\t\t\"dbMethod\":\"mod_hash(id)\"\n" +
"\t\t\t\t}", Map.class)).build());
logicSchemaConfig.getShardingTables().put("seqSharding", seqMainSharding);
}
Expand Down

0 comments on commit 5fac637

Please sign in to comment.