Skip to content

Commit 4d1368c

Browse files
committed
Fix test
1 parent 0095e6b commit 4d1368c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

infra/rewrite/core/src/main/java/org/apache/shardingsphere/infra/rewrite/engine/RouteSQLRewriteEngine.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ public RouteSQLRewriteResult rewrite(final SQLRewriteContext sqlRewriteContext,
8181

8282
private int getMaxUnionSizePerDataSource(final QueryContext queryContext) {
8383
ConfigurationProperties props = queryContext.getMetaData().getProps();
84-
Integer result = null == props ? null : props.getValue(ConfigurationPropertyKey.MAX_UNION_SIZE_PER_DATASOURCE);
85-
return null == result ? Integer.parseInt(ConfigurationPropertyKey.MAX_UNION_SIZE_PER_DATASOURCE.getDefaultValue()) : result;
84+
if (null == props || null == props.getProps()) {
85+
return Integer.parseInt(ConfigurationPropertyKey.MAX_UNION_SIZE_PER_DATASOURCE.getDefaultValue());
86+
}
87+
return props.<Integer>getValue(ConfigurationPropertyKey.MAX_UNION_SIZE_PER_DATASOURCE);
8688
}
8789

8890
private Map<RouteUnit, SQLRewriteUnit> createSQLRewriteUnits(final SQLRewriteContext sqlRewriteContext, final RouteContext routeContext, final int maxUnionSizePerDataSource) {

0 commit comments

Comments
 (0)