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/20 05:43:49 UTC

[GitHub] [incubator-shardingsphere] joooohnli opened a new issue #2062: Wrong LIMIT rewrite while GROUP BY and ORDER BY on different items

joooohnli opened a new issue #2062: Wrong LIMIT rewrite while GROUP BY and ORDER BY on different items
URL: https://github.com/apache/incubator-shardingsphere/issues/2062
 
 
   ## 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 
   ### Expected behavior
   limit 0, 10
   ### Actual behavior
   ```
    SQL: select max(sid) as sid, max(sendTime) as sendTime, objectId, sum(0) as unreadCount from TEST where memberId = ? and status != -1 group by objectId order by sendTime desc limit ?, ?
   SQL-BindValue: 52146792, 0, 2147483647
   ```
   ### Reason analyze (If you can)
   logic error:
   
   io.shardingsphere.core.routing.router.sharding.ParsingSQLRouter#processLimit
   ![image](https://user-images.githubusercontent.com/1615053/54658329-dca27780-4b07-11e9-9b5d-922d43c78caf.png)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   Run it with PreparedStatement:
   ```
   select max(sid) as sid, max(sendTime) as sendTime, objectId, sum(0) as unreadCount from TEST where memberId = ? and status != -1 group by objectId order by sendTime desc limit ?, ?
   ```
   ### Example codes for reproduce this issue (such as a github link).

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