You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/03/07 02:36:34 UTC

[GitHub] [incubator-shardingsphere] m65536 opened a new issue #1984: single shards limit error

m65536 opened a new issue #1984: single shards limit error
URL: https://github.com/apache/incubator-shardingsphere/issues/1984
 
 
   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/sharding-sphere/sharding-sphere/issues).
   - Read documentation: [ShardingSphere Doc](http://shardingsphere.io/document/current/en/overview/).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   > 3.1.0
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   > sharding-jdbc-core
   ### Expected behavior
   
   ### Actual behavior
   > 分页查询路由到单表后,ParsingSQLRouter对limit做了改写(不需要改写limit语句),但是又没有做归并。
   ### Reason analyze (If you can)
   > 路由到单表本来不需要做sql改写,`3.0.0.M1`这个版本是正确,对公比代码如下:
   * `3.0.0.M1`
   ```
    private void processLimit(List<Object> parameters, SelectStatement selectStatement, boolean isSingleRouting) {
           if (isSingleRouting) {
               selectStatement.setLimit((Limit)null);
           } else {
               boolean isNeedFetchAll = (!selectStatement.getGroupByItems().isEmpty() || !selectStatement.getAggregationSelectItems().isEmpty()) && !selectStatement.isSameGroupByAndOrderByItems();
               selectStatement.getLimit().processParameters(parameters, isNeedFetchAll);
           }
       }
   ```
   * `3.1.0`
   ```
      private void processLimit(final List<Object> parameters, final SelectStatement selectStatement) {
           boolean isNeedFetchAll = (!selectStatement.getGroupByItems().isEmpty() || !selectStatement.getAggregationSelectItems().isEmpty()) && !selectStatement.isSameGroupByAndOrderByItems();
           selectStatement.getLimit().processParameters(parameters, isNeedFetchAll, databaseType);
       }
   ```
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services