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 2021/03/24 01:06:08 UTC

[GitHub] [shardingsphere] larrychen8276 opened a new issue #9793: SQLParsingException

larrychen8276 opened a new issue #9793:
URL: https://github.com/apache/shardingsphere/issues/9793


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   - 4.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   - ShardingSphere-JDBC
   - 
   ### Expected behavior
   ```
   (select t.id, t.category_id, t.category_name from ppt_p_contents t where t.type = 1 and t.show_in_home = 3 order by t.create_time desc limit 8 ) 
   union all (select t.id, t.category_id, t.category_name from ppt_p_contents t where t.type = 1 and t.show_in_home = 4 order by t.create_time desc limit 8 ) 
   union all (select t.id, t.category_id, t.category_name from ppt_p_contents t where t.type = 1 and t.show_in_home = 5 order by t.create_time desc limit 8 )
   ```
   
   ### Actual behavior
   ```
   line 1:0 no viable alternative at input '('
   line 1:0 extraneous input '(' expecting {SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE, SET, WITH, DESC, BEGIN, COMMIT, ROLLBACK, SAVEPOINT, CALL, USE, DESCRIBE, SHOW, REPLACE, START, CHANGE, RENAME, REPAIR, STOP}
   3月 24, 2021 8:53:37 上午 org.apache.catalina.core.ApplicationDispatcher invoke
   SEVERE: Servlet.service() for servlet [springMvc] threw exception
   org.apache.shardingsphere.sql.parser.exception.SQLParsingException: Unsupported SQL of `(select t.id, t.category_id, t.category_name, t.tags_id, t.tags_name, t.title, t.content, t.download_count, t.show_in_home, t.user_id, t.pic, t.detail_pic, t.type, t.ppt_folder_name, t.ppt_file_name, t.ppt_file_size, t.ppt_amount, t.table_name, t.create_time  from ppt_p_contents t where t.type = 1 and t.show_in_home = 1 order by t.create_time desc limit 8 )  union all  (select t.id, t.category_id, t.category_name, t.tags_id, t.tags_name, t.title, t.content, t.download_count, t.show_in_home, t.user_id, t.pic, t.detail_pic, t.type, t.ppt_folder_name, t.ppt_file_name, t.ppt_file_size, t.ppt_amount, t.table_name, t.create_time  from ppt_p_contents t where t.type = 1 and t.show_in_home = 2 order by t.create_time desc limit 8 )  union all  (select t.id, t.category_id, t.category_name, t.tags_id, t.tags_name, t.title, t.content, t.download_count, t.show_in_home, t.user_id, t.pic, t.detail_pic, t.type,
  t.ppt_folder_name, t.ppt_file_name, t.ppt_file_size, t.ppt_amount, t.table_name, t.create_time  from ppt_p_contents t where t.type = 1 and t.show_in_home = 3 order by t.create_time desc limit 8 )  union all  (select t.id, t.category_id, t.category_name, t.tags_id, t.tags_name, t.title, t.content, t.download_count, t.show_in_home, t.user_id, t.pic, t.detail_pic, t.type, t.ppt_folder_name, t.ppt_file_name, t.ppt_file_size, t.ppt_amount, t.table_name, t.create_time  from ppt_p_contents t where t.type = 1 and t.show_in_home = 4 order by t.create_time desc limit 8 )  union all  (select t.id, t.category_id, t.category_name, t.tags_id, t.tags_name, t.title, t.content, t.download_count, t.show_in_home, t.user_id, t.pic, t.detail_pic, t.type, t.ppt_folder_name, t.ppt_file_name, t.ppt_file_size, t.ppt_amount, t.table_name, t.create_time  from ppt_p_contents t where t.type = 1 and t.show_in_home = 5 order by t.create_time desc limit 8 )  union all  (select t.id, t.category_id, t.category_name
 , t.tags_id, t.tags_name, t.title, t.content, t.download_count, t.show_in_home, t.user_id, t.pic, t.detail_pic, t.type, t.ppt_folder_name, t.ppt_file_name, t.ppt_file_size, t.ppt_amount, t.table_name, t.create_time  from ppt_p_contents t where t.type = 1 and t.show_in_home = 6 order by t.create_time desc limit 8 )  union all  (select t.id, t.category_id, t.category_name, t.tags_id, t.tags_name, t.title, t.content, t.download_count, t.show_in_home, t.user_id, t.pic, t.detail_pic, t.type, t.ppt_folder_name, t.ppt_file_name, t.ppt_file_size, t.ppt_amount, t.table_name, t.create_time  from ppt_p_contents_shouchaobao t where t.type = 1 and t.show_in_home = 7 order by t.create_time desc limit 8 ) `
   	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.SimpleQueryPrepareEngine.route(SimpleQueryPrepareEngine.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.MasterSlaveStatement.executeQuery(MasterSlaveStatement.java:88)
   	at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:452)
   ```
   
   ### 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).
   


-- 
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] strongduanmu commented on issue #9793: SQLParsingException

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


   This sql has been supported in the master branch, you can try 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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu closed issue #9793: SQLParsingException

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


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #9793: SQLParsingException

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


   @larrychen8276 union all/union had supported on master branch without sharding tables or broadcast tables.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #9793: SQLParsingException

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


   @larrychen8276 This is an `antlr` parsing exception. You can upgrade to the latest version, which is already supported.


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