joooohnli commented on issue #2062: Wrong LIMIT rewrite while GROUP BY and ORDER BY on different items URL: https://github.com/apache/incubator-shardingsphere/issues/2062#issuecomment-475128566 @tuohai666 Here is the example code ``` connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement("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 ?, ?"); preparedStatement.setInt(1, 123); preparedStatement.setInt(2, 0); preparedStatement.setInt(3, 10); ResultSet resultSet = preparedStatement.executeQuery(); ``` And TEST is just a single table in defaultDataSource. (in fact this issue also occurs to sharding table) The log comes from my jdbc monitor, it shows the real sql that jdbc sends to physical db. If you think the log is not convincing. I can show you the debug info: io.shardingsphere.core.parsing.parser.context.limit.Limit#rewrite  Actually you could have reproduced this bug according to the **Steps to reproduce the behavior**.
---------------------------------------------------------------- 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] With regards, Apache Git Services
