You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/08/06 02:13:39 UTC

[GitHub] [shardingsphere] rongflag opened a new issue #6655: SqlServer : no viable alternative at input 'WITH'

rongflag opened a new issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   ShardingSphere-JDBC 4.1.1 
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   
   ### Actual behavior
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   
   SQL: 
   WITH selectTemp AS (SELECT TOP 100 PERCENT ROW_NUMBER() OVER (ORDER BY CURRENT_TIMESTAMP) as __row_number__, role_id, role_name, role_code, role_desc, ds_type, ds_scope, create_time, update_time, del_flag FROM sys_role WHERE del_flag = '0' AND tenant_id = 1) SELECT * FROM selectTemp WHERE __row_number__ BETWEEN 1 AND 20 ORDER BY __row_number__ 
   
   LOG::
   line 1:0 no viable alternative at input 'WITH'
   line 1:0 mismatched input 'WITH' expecting {SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE, SET, IF, BEGIN, COMMIT, ROLLBACK, CALL, DENY, SAVE}
   
   ERRORE:
   Caused by: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: Unsupported SQL of `WITH selectTemp AS (SELECT TOP 100 PERCENT  ROW_NUMBER() OVER (ORDER BY CURRENT_TIMESTAMP) as __row_number__,  role_id, role_name, role_code, role_desc, ds_type, ds_scope, create_time, update_time, del_flag FROM sys_role WHERE del_flag = '0' AND tenant_id = 1) SELECT * FROM selectTemp WHERE __row_number__ BETWEEN 1 AND 20 ORDER BY __row_number__`
   	at org.apache.shardingsphere.sql.parser.core.parser.SQLParserExecutor.execute(SQLParserExecutor.java:49)
   	at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse0(SQLParserEngine.java:79)
   	at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61)
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.createRouteContext(DataNodeRouter.java:97)
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:89)
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76)
   	at org.apache.shardingsphere.underlying.pluggble.prepare.PreparedQueryPrepareEngine.route(PreparedQueryPrepareEngine.java:54)
   	at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96)
   	at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.MasterSlavePreparedStatement.<init>(MasterSlavePreparedStatement.java:65)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.MasterSlavePreparedStatement.<init>(MasterSlavePreparedStatement.java:49)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.connection.MasterSlaveConnection.prepareStatement(MasterSlaveConnection.java:74)
   	at sun.reflect.GeneratedMethodAccessor241.invoke(Unknown Source)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:55)
   	at com.sun.proxy.$Proxy171.prepareStatement(Unknown Source)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:86)
   	at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88)
   	... 151 common frames omitted
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] kimmking edited a comment on issue #6655: SqlServer : no viable alternative at input 'WITH'

Posted by GitBox <gi...@apache.org>.
kimmking edited a comment on issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655#issuecomment-679468761


   @dongzl @rongflag  window function is not supported yet( mysql  pg  sqlserver etc.).


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] kimmking closed issue #6655: SqlServer : no viable alternative at input 'WITH'

Posted by GitBox <gi...@apache.org>.
kimmking closed issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6655: SqlServer : no viable alternative at input 'WITH'

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655#issuecomment-669653774


   Hi @rongflag I think `Sharding Parser` does not support parsing this SQL `WITH...`. Currently, we are seeking help for the community to polish the SQL definitions of SQLServer. If you are interested in it, I suggest you try to fix it referring to [Guideline](https://github.com/apache/shardingsphere/issues/6478).


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] kimmking commented on issue #6655: SqlServer : no viable alternative at input 'WITH'

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655#issuecomment-679468761


   @dongzl @rongflag  window function is not supported yet.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6655: SqlServer : no viable alternative at input 'WITH'

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655#issuecomment-679470624


   @kimmking Maybe we can give @dongzl a chance to fix it. :-)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero edited a comment on issue #6655: SqlServer : no viable alternative at input 'WITH'

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655#issuecomment-669653774


   Hi @rongflag I think `Sharding Parser` does not support parsing this SQL `WITH...`. Currently, we are seeking help for the community to polish the SQL definitions of SQLServer. If you are interested in it, I suggest you try to fix it referring to [Guideline](https://github.com/apache/shardingsphere/issues/6478).
   
   Besides, since @dongzl are the assignee of #6478, you can contact him for help. :)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] kimmking closed issue #6655: SqlServer : no viable alternative at input 'WITH'

Posted by GitBox <gi...@apache.org>.
kimmking closed issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] dongzl commented on issue #6655: SqlServer : no viable alternative at input 'WITH'

Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #6655:
URL: https://github.com/apache/shardingsphere/issues/6655#issuecomment-674497691


   I will fix it.


----------------------------------------------------------------
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:
users@infra.apache.org