<p dir="auto"><strong>Which version of ShardingSphere did you use?</strong><br>
5.0.0-alpha<br>
<strong>Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?</strong><br>
ShardingSphere-JDBC<br>
<strong>Expected behavior</strong><br>
Correct paging<br>
<strong>Actual behavior</strong><br>
Wrong pagination, except for the first page<br>
<strong>Reason analyze</strong><br>
When I use a paged query,It seems that the rewrite engine did not rewrite the paging parameters.<br>
<strong>Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</strong><br>
Environment: shardingsphere-jdbc-core 5.0.0-alpha sharding configuration with JavaAPI,SpringBoot v2.1.5.RELEASE,Oracle 11g,JPA<br>
Only one table slice is configured,the rule is: inline,TABLENAME_${KEY}.<br>
One physical table has two records, and two other physical tables have one record, and the rest have no records.<br>
When the third page is queried with pagesize 1, it will not be found.<br>
My code is: <code class="notranslate">entityManager.createQuery(cq).setFirstResult(2).setMaxResults(1).getResultList();</code><br>
Logic  SQL: .<code class="notranslate">..) row_ where rownum &lt;= ?) where rownum_ &gt; ? ::: [3, 2]</code><br>
Actual SQL: <code class="notranslate">...) row_ where rownum &lt;= ?) where rownum_ &gt; ? ::: [3, 2]</code></p>
<p dir="auto">Hi, we are glad you can fix this issue to become a contributor to Apache Sharding Sphere.<br>
Welcome! <g-emoji class="g-emoji" alias="smiley" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f603.png">😃</g-emoji></p>
<p dir="auto">By doing this assignment, you can learn more about how a query SQL is parsed and how to verify the parsing result of a SQL in Apache ShardingSphere.</p>
<p dir="auto"><strong>This issue is to</strong> add the parsing assertion for <code class="notranslate">ComplexExpressionSegment </code> by adding the <code class="notranslate">start-index</code> and <code class="notranslate">stop-index</code> attributes in <code class="notranslate">parsing-result.xml</code>.</p>
<p dir="auto">It is not difficult, and the following comment also gives you the detailed instruction. BTW, if you need any help, please be free to reply to this one.</p>