You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/10/27 09:49:21 UTC

[GitHub] [shardingsphere] xiehaib commented on issue #13312: `ShardingUnicastRoutingEngine` provides an incorrect random datasource

xiehaib commented on issue #13312:
URL: https://github.com/apache/shardingsphere/issues/13312#issuecomment-952741121


   I might *WhereClauseShardingConditionEngine.mergeShardingConditionValues*  has missed an *AlwaysFalseShardingConditionValue* case
   ```
   
   private ShardingConditionValue mergeShardingConditionValues(final Column column, final Collection<ShardingConditionValue> shardingConditionValues) {
         ......
           for (ShardingConditionValue each : shardingConditionValues) {
               if (each instanceof ListShardingConditionValue) {
                  ......
               } else if (each instanceof RangeShardingConditionValue) {
                   try {
                       rangeValue = mergeRangeShardingValues(((RangeShardingConditionValue) each).getValueRange(), rangeValue);
   +                    // [1000, 1000)
   +                    if (rangeValue.hasLowerBound() && rangeValue.hasUpperBound()
   +                            && rangeValue.lowerEndpoint() == rangeValue.upperBoundType()
   +                            && !(rangeValue.upperBoundType() == BoundType.CLOSED 
   +                                    && rangeValue.lowerEndpoint() == BoundType.CLOSED)) {
   +                        return new AlwaysFalseShardingConditionValue();
   +                    }
                   } catch (final IllegalArgumentException ex) {
                       return new AlwaysFalseShardingConditionValue();
                   }
               }
           }
   ......
       }
   ```


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org