kuchikij opened a new issue, #21610:
URL: https://github.com/apache/shardingsphere/issues/21610

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   5.2.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   SQL query successfully in Oracle database.
   
   ### Actual behavior
   SQL query error in Oracle database. The following problems are encountered.
   
   **java.lang.ClassCastException: 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression
 cannot be cast to 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ParameterMarkerExpressionSegment**
   at 
org.apache.shardingsphere.infra.binder.segment.select.pagination.engine.RowNumberPaginationContextEngine.createRowNumberValueSegment(RowNumberPaginationContextEngine.java:142)
   at 
org.apache.shardingsphere.infra.binder.segment.select.pagination.engine.RowNumberPaginationContextEngine.createPaginationWithRowNumber(RowNumberPaginationContextEngine.java:129)
   at 
org.apache.shardingsphere.infra.binder.segment.select.pagination.engine.RowNumberPaginationContextEngine.createPaginationContext(RowNumberPaginationContextEngine.java:67)
   at 
org.apache.shardingsphere.infra.binder.segment.select.pagination.engine.PaginationContextEngine.createPaginationContext(PaginationContextEngine.java:68)
   at 
org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext.(SelectStatementContext.java:117)
   at 
org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext.createSubqueryContexts(SelectStatementContext.java:124)
   at 
org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext.(SelectStatementContext.java:110)
   at 
org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.getDMLStatementContext(SQLStatementContextFactory.java:162)
   at 
org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.newInstance(SQLStatementContextFactory.java:145)
   at 
org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.newInstance(SQLStatementContextFactory.java:130)
   at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.(ShardingSpherePreparedStatement.java:193)
   at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.(ShardingSpherePreparedStatement.java:156)
   at 
org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection.prepareStatement(ShardingSphereConnection.java:88)
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   The sql like following:
   ```
   select *
     from (select Res.*, rownum as rn
             from (select a.*
                     from t_customergroup_relation a
                    where a.group_id = :group_id
                    order by a.group_id, a.cust_id) Res
            where rownum <= :page_no * :page_size)
    where rn > (:page_no - 1) * :page_size
   ```
   The config like following:
   ```
   
spring.shardingsphere.rules.sharding.tables.t_customergroup_relation.actual-data-nodes=ds.t_cust_group_rel_$->{1..9999}
   
spring.shardingsphere.rules.sharding.tables.t_customergroup_relation.table-strategy.standard.sharding-column=group_id
   
spring.shardingsphere.rules.sharding.tables.t_customergroup_relation.table-strategy.standard.sharding-algorithm-name=t-customergroup-relation-inline
   
spring.shardingsphere.rules.sharding.sharding-algorithms.t-customergroup-relation-inline.type=INLINE
   
spring.shardingsphere.rules.sharding.sharding-algorithms.t-customergroup-relation-inline.props.algorithm-expression=t_cust_group_rel_$->{group_id}
   ```
   
   ### 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.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to