-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Using rownum greater than or equal to or less than or equal to the result of paging is incorrect in Oracle #490
Comments
sql改写会改为0,但归并时会按1归并。这个不是bug。 |
@terrymanu 使用的是官网提供的"sharding-jdbc-raw-jdbc-java-example"这个工程,作了简单的修改: |
fixed at 2.0.1 |
在Oracle下使用Shardingjdbc的分页时遇到一个问题,比如我的SQL是:SELECT * FROM (SELECT A1., ROWNUM RN1 FROM (SELECT * FROM t_order ORDER BY user_id DESC) A1 WHERE ROWNUM <= 10) B WHERE B.RN1 >= 1,正常情况下应该返回10条数据,但是Shardingjdbc返回了9条数据,漏掉了本来的第一条数据。我看了一下在每个分片的执行语句:SELECT * FROM (SELECT A1., ROWNUM RN1 FROM (SELECT * FROM t_order_0 ORDER BY user_id DESC) A1 WHERE ROWNUM <= 10) B WHERE B.RN1 >= 0,这里RowNum变成从0开始的,是Shardingjdbc默认RowNum从0开始吗,这里Shardingjdbc的处理逻辑是怎样的呢,还是说这里存在Bug?
The text was updated successfully, but these errors were encountered: