tristaZero commented on a change in pull request #7353:
URL: https://github.com/apache/shardingsphere/pull/7353#discussion_r487343637
##########
File path:
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/WhereClauseShardingConditionEngine.java
##########
@@ -73,21 +78,25 @@
List<ShardingCondition> result = new ArrayList<>();
Optional<WhereSegment> whereSegment = ((WhereAvailable)
sqlStatementContext).getWhere();
if (whereSegment.isPresent()) {
- result.addAll(createShardingConditions(sqlStatementContext,
whereSegment.get().getAndPredicates(), parameters));
+ result.addAll(createShardingConditions(sqlStatementContext,
whereSegment.get().getExpr(), parameters));
}
Collection<WhereSegment> subqueryWhereSegments =
sqlStatementContext.getSqlStatement() instanceof SelectStatement
?
WhereSegmentExtractUtils.getSubqueryWhereSegments((SelectStatement)
sqlStatementContext.getSqlStatement()) : Collections.emptyList();
for (WhereSegment each : subqueryWhereSegments) {
- Collection<ShardingCondition> subqueryShardingConditions =
createShardingConditions(sqlStatementContext, each.getAndPredicates(),
parameters);
+ Collection<ShardingCondition> subqueryShardingConditions =
createShardingConditions(sqlStatementContext, each.getExpr(), parameters);
if (!result.containsAll(subqueryShardingConditions)) {
result.addAll(subqueryShardingConditions);
}
}
return result;
}
- private Collection<ShardingCondition> createShardingConditions(final
SQLStatementContext sqlStatementContext, final Collection<AndPredicate>
andPredicates, final List<Object> parameters) {
+ private Collection<ShardingCondition> createShardingConditions(final
SQLStatementContext sqlStatementContext, final ExpressionSegment
expressionSegment, final List<Object> parameters) {
Collection<ShardingCondition> result = new LinkedList<>();
+
Review comment:
Remove
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]