Anricx opened a new issue #8167:
URL: https://github.com/apache/shardingsphere/issues/8167


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   4.1.1
   ### Which project did you use? 
   ShardingSphere-JDBC
   
   ### Reason analyze (If you can)
   
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   #### CASE1 
   *Logic SQL*
   ```sql
   SELECT  id
           FROM `_parking_payment_plus`
            WHERE `identity` = ?                        
                   AND `pay_value` >= ?          
               ORDER BY `id` ASC
               LIMIT ?, ?
   ```
   *Actual SQL*
   ```sql
   [2020-11-16 10:14:15.792] INFO  [main] [ShardingSphere-SQL] - Actual SQL: 
parking_2020 ::: SELECT  
           `id`
           FROM `_parking_payment`
            WHERE `identity` = ?
                   AND `pay_value` >= ? 
               ORDER BY `id` ASC
               LIMIT ?, ? ::: [6qyE6JG04KSO5Ymc64Kq4buO, 1, 0, 10]
   ```
   Works fine!
   
   #### CASE2
   *Logic SQL*
   ```sql
   SELECT  id
           FROM `_parking_payment_plus`
            WHERE `identity` = ?                        
                   AND `pay_value` + `free+value` >= ?          
               ORDER BY `id` ASC
               LIMIT ?, ?
   ```
   *Actual SQL*
   ```sql
   [2020-11-16 10:18:50.868] INFO  [main] [ShardingSphere-SQL] - Actual SQL: 
parking_2020 ::: SELECT  
           `id`
           FROM `_parking_payment`
            WHERE `identity` = ?
                   AND `pay_value` + `free_value` >= ? 
               ORDER BY `id` ASC
               LIMIT ?, ? ::: [6qyE6JG04KSO5Ymc64Kq4buO, 0, 1, 10]
   ```
   
   While where contains `a + b`(here is `pay_value` + `free_value` >= ? ) 
expression SQL PrepareStatement argument order changed!
   
   PS: this code works fine version `4.0.0`!
   


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


Reply via email to