Oliver-GMJ commented on issue #26922:
URL: 
https://github.com/apache/shardingsphere/issues/26922#issuecomment-1637468277

   @strongduanmu Hi, I try these 2 examples.
   1. 
   ```xml
   <select id="queryPageByLevel" resultType="com.xxx.Demo01">
       SELECT
       *
       FROM temp_test_gmj WHERE 1=1
       LIMIT (#{page} - 1) * #{pageSize}, #{pageSize}
   </select>
   ```
   Wrong:
   ```
   org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have 
an error in your SQL syntax: SELECT
           *
           FROM temp_test_gmj WHERE 1=1
           LIMIT (? - 1) * ?, ?, no viable alternative at input 
'SELECT*FROMtemp_test_gmjWHERE1=1LIMIT(' at line 4, position 14, near 
[@9,68:68='(',<30>,4:14]
   ```
   2. 
   ```xml
   <select id="queryPageByLevel" resultType="com.xxx.Demo01">
       SELECT
       *
       FROM temp_test_gmj WHERE 1=1
       LIMIT 0, #{pageSize}
   </select>
   ```
   Success:
   ```
   Actual SQL: ds_sharding ::: SELECT
           *
           FROM temp_test_gmj WHERE 1=1
           LIMIT 0, ? ::: [10]
   ```


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