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/06/15 16:45:28 UTC

[GitHub] [shardingsphere] think-gem opened a new issue #10827: readwrite-splitting Caused by: java.lang.IllegalStateException: union select is not supported yet.

think-gem opened a new issue #10827:
URL: https://github.com/apache/shardingsphere/issues/10827


   ## Bug Report
   
   Use readwrite-splitting report:  union select is not supported yet.
   
   ### Which version of ShardingSphere did you use?
   
   5.0.0-bata
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   
   1. I know I can fix this by specifying a different data source, but I expect
   2. Can configure parameters, specific statements, and use mandatory master database queries
   3. If sql parse error, print the warning log, and force the primary database query
   
   ### Actual behavior
   
   Caused by: java.lang.IllegalStateException: union select is not supported yet.
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ```
   Caused by: java.lang.IllegalStateException: union select is not supported yet.
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpressionBody(MySQLStatementSQLVisitor.java:594)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpressionBody(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionBodyContext.accept(MySQLStatementParser.java:4373)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpression(MySQLStatementSQLVisitor.java:564)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpression(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionContext.accept(MySQLStatementParser.java:4279)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpressionParens(MySQLStatementSQLVisitor.java:541)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpressionParens(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionParensContext.accept(MySQLStatementParser.java:4530)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitSubquery(MySQLStatementSQLVisitor.java:533)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitSubquery(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$SubqueryContext.accept(MySQLStatementParser.java:9515)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitTableFactor(MySQLStatementSQLVisitor.java:1326)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitTableFactor(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$TableFactorContext.accept(MySQLStatementParser.java:8287)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitTableReference(MySQLStatementSQLVisitor.java:1315)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitTableReference(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$TableReferenceContext.accept(MySQLStatementParser.java:7737)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitTableReferences(MySQLStatementSQLVisitor.java:1281)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitTableReferences(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$TableReferencesContext.accept(MySQLStatementParser.java:7613)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQuerySpecification(MySQLStatementSQLVisitor.java:605)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQuerySpecification(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QuerySpecificationContext.accept(MySQLStatementParser.java:4684)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementBaseVisitor.visitQueryPrimary(MySQLStatementBaseVisitor.java:237)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryPrimaryContext.accept(MySQLStatementParser.java:4601)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpressionBody(MySQLStatementSQLVisitor.java:592)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpressionBody(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionBodyContext.accept(MySQLStatementParser.java:4373)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpression(MySQLStatementSQLVisitor.java:564)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpression(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionContext.accept(MySQLStatementParser.java:4279)
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitSelect(MySQLStatementSQLVisitor.java:1140)
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitSelect(MySQLStatementSQLVisitor.java:198)
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$SelectContext.accept(MySQLStatementParser.java:4112)
   	at org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine.visit(SQLVisitorEngine.java:49)
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:47)
   	at org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader.load(SQLStatementCacheLoader.java:40)
   	at org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader.load(SQLStatementCacheLoader.java:29)
   	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
   	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
   	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
   	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
   	... 167 common frames omitted
   ```
   
   ### 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 #10827: readwrite-splitting Caused by: java.lang.IllegalStateException: union select is not supported yet.

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


   @think-gem I am very sorry to tell you that `UNION` is not supported now, you can refer to the [document](https://shardingsphere.apache.org/document/current/cn/features/sharding/use-norms/sql/#%E4%B8%8D%E6%94%AF%E6%8C%81%E7%9A%84sql-1) for details.


-- 
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 #10827: readwrite-splitting Caused by: java.lang.IllegalStateException: union select is not supported yet.

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


   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 #10827: readwrite-splitting Caused by: java.lang.IllegalStateException: union select is not supported yet.

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


   


-- 
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 #10827: readwrite-splitting Caused by: java.lang.IllegalStateException: union select is not supported yet.

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


   @strongduanmu union/ union all had supported in readwrite-splitting on master branch now.


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