Oliver-GMJ commented on issue #26922:
URL:
https://github.com/apache/shardingsphere/issues/26922#issuecomment-1637439849
Run failed.
Mapper:
```xml
<select id="queryPage" resultType="com.xxx.vo.DemoVO">
SELECT
*
FROM temp_test_gmj WHERE 1=1
LIMIT #{pageSize} OFFSET (#{page} - 1) * #{pageSize}
</select>
```
Exception:
```
org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have
an error in your SQL syntax: SELECT
*
FROM temp_test_gmj WHERE 1=1
LIMIT ? OFFSET (? - 1) * ?, no viable alternative at input 'OFFSET'
at line 4, position 16, near [@10,70:75='OFFSET',<483>,4:16]
```
Correct SQL:
```xml
<select id="queryPage" resultType="com.xxx.vo.DemoVO">
SELECT
*
FROM temp_test_gmj WHERE 1=1
LIMIT #{pageSize} OFFSET 0
</select>
```
```
SELECT
*
FROM temp_test_gmj WHERE 1=1
LIMIT ? OFFSET 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]