jxch-1024 opened a new issue, #23926:
URL: https://github.com/apache/shardingsphere/issues/23926

   
   According to the official website sqlserver pagination, the pagination sql 
is given as follows:
   
   _SELECT * FROM (SELECT TOP (?) ROW_NUMBER() OVER (ORDER BY o.order_id DESC) 
AS rownum, * FROM t_order o) AS temp WHERE temp.rownum > ? ORDER BY 
temp.order_id_
   
   However, when I use version 5.1.2, I prompt a syntax error, which seems to 
be that antlr cannot be parsed.
   
   Error stack:
   15:55:10.856 [main] DEBUG org.springframework.jdbc.core.JdbcTemplate - 
Executing SQL query [SELECT * FROM (SELECT TOP (2) ROW_NUMBER() OVER (ORDER BY 
o.order_id DESC) AS rownum, * FROM t_order o) AS temp WHERE temp.rownum > 1 
ORDER BY temp.order_id]
   15:55:10.878 [main] DEBUG 
org.springframework.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection 
from DataSource
   Exception in thread "main" 
org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an 
error in your SQL syntax
        at 
org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.twoPhaseParse(SQLParserExecutor.java:65)
        at 
org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.parse(SQLParserExecutor.java:46)
        at 
org.apache.shardingsphere.sql.parser.api.SQLParserEngine.parse(SQLParserEngine.java:47)
        at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:48)
        at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:47)
        at 
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:58)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement.createLogicSQL(ShardingSphereStatement.java:458)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement.executeQuery(ShardingSphereStatement.java:150)
        at 
org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:452)
        at 
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:381)
        at 
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:465)
        at 
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:475)
        at 
org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:525)
        at com.luhui.shardingjdbc.demo.MainTest.main(MainTest.java:39)
   
   
   
   


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