ArcherTrister opened a new issue #10470:
URL: https://github.com/apache/shardingsphere/issues/10470


   ## 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?
   5.0.0-alpha
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   OK
   ### Actual behavior
   get an error
   
   Starting the ShardingSphere-Proxy ...
   [INFO ] 08:58:39.984 [main] ShardingSphere-metadata - Loading 8 tables' meta 
data for unconfigured tables.
   [INFO ] 08:58:39.995 [main] ShardingSphere-metadata - Loading 8 tables' meta 
data for unconfigured tables.
   [INFO ] 08:58:40.007 [main] ShardingSphere-metadata - Loading 8 tables' meta 
data for unconfigured tables.
   [INFO ] 08:58:40.010 [main] ShardingSphere-metadata - Loading 8 tables' meta 
data for unconfigured tables.
   [INFO ] 08:58:40.015 [main] o.a.s.i.c.s.SchemaContextsBuilder - Load meta 
data for schema replica_query_db finished, cost 98 milliseconds.
   Thanks for using Atomikos! Evaluate 
http://www.atomikos.com/Main/ExtremeTransactions for advanced features and 
professional support
   or register at http://www.atomikos.com/Main/RegisterYourDownload to disable 
this message and receive FREE tips & advice
   [INFO ] 08:58:40.128 [main] o.a.s.p.i.i.AbstractBootstrapInitializer - 
Database name is `MySQL`, version is `5.7.33-log`
   [INFO ] 08:58:42.411 [main] o.a.s.p.frontend.ShardingSphereProxy - 
ShardingSphere-Proxy start success.
   [INFO ] 08:59:09.025 [ShardingSphere-Command-0] ShardingSphere-SQL - Logic 
SQL: SET NAMES utf8mb4;
   [INFO ] 08:59:09.026 [ShardingSphere-Command-0] ShardingSphere-SQL - 
SQLStatement: MySQLSetStatement()
   [INFO ] 08:59:09.026 [ShardingSphere-Command-0] ShardingSphere-SQL - Actual 
SQL: primary_ds ::: SET NAMES utf8mb4;
   [ERROR] 08:59:09.180 [ShardingSphere-Command-1] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   java.lang.ClassCastException: class 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExistsSubqueryExpression
 cannot be cast to class 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment
 
(org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExistsSubqueryExpression
 and 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment
 are in unnamed module of loader 'app')
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.createProjection(MySQLStatementSQLVisitor.java:1137)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitProjection(MySQLStatementSQLVisitor.java:1093)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitProjection(MySQLStatementSQLVisitor.java:146)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ProjectionContext.accept(MySQLStatementParser.java:6338)
           at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitProjections(MySQLStatementSQLVisitor.java:1064)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitProjections(MySQLStatementSQLVisitor.java:146)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ProjectionsContext.accept(MySQLStatementParser.java:5763)
           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:537)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQuerySpecification(MySQLStatementSQLVisitor.java:146)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QuerySpecificationContext.accept(MySQLStatementParser.java:4088)
           at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementBaseVisitor.visitQueryPrimary(MySQLStatementBaseVisitor.java:223)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryPrimaryContext.accept(MySQLStatementParser.java:4005)
           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:529)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpressionBody(MySQLStatementSQLVisitor.java:146)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionBodyContext.accept(MySQLStatementParser.java:3840)
           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:513)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitQueryExpression(MySQLStatementSQLVisitor.java:146)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionContext.accept(MySQLStatementParser.java:3749)
           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:1020)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitSelect(MySQLStatementSQLVisitor.java:146)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$SelectContext.accept(MySQLStatementParser.java:3582)
           at 
org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine.visit(SQLVisitorEngine.java:45)
           at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:65)
           at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:53)
           at 
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse0(ShardingSphereSQLParserEngine.java:74)
           at 
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:60)
           at 
org.apache.shardingsphere.proxy.backend.text.TextProtocolBackendHandlerFactory.newInstance(TextProtocolBackendHandlerFactory.java:63)
           at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.<init>(MySQLComQueryPacketExecutor.java:54)
           at 
org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecutorFactory.newInstance(MySQLCommandExecutorFactory.java:70)
           at 
org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecuteEngine.getCommandExecutor(MySQLCommandExecuteEngine.java:60)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:99)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:76)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
           at java.base/java.lang.Thread.run(Thread.java:834)
   [ERROR] 08:59:09.232 [ShardingSphere-Command-2] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   
org.apache.shardingsphere.proxy.frontend.exception.UnsupportedCommandException: 
null
           at 
org.apache.shardingsphere.proxy.frontend.mysql.command.generic.MySQLUnsupportedCommandExecutor.execute(MySQLUnsupportedCommandExecutor.java:38)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:100)
           at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:76)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
           at java.base/java.lang.Thread.run(Thread.java:834)
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   SQL to execute: SELECT EXISTS (SELECT 1 FROM `table`)
   sharding rule configuration: 
   
   server.yaml
   authentication:
     users:
       root:
         password: root
       sharding:
         password: sharding
         authorizedSchemas: sharding_db
   props:
     max-connections-size-per-query: 1
     acceptor-size: 16 # The default value is available processors count * 2.
     executor-size: 16 # Infinite by default.
     proxy-frontend-flush-threshold:
       128 # The default value is 128.
       # LOCAL: Proxy will run with LOCAL transaction.
       # XA: Proxy will run with XA transaction.
       # BASE: Proxy will run with B.A.S.E transaction.
     proxy-transaction-type: LOCAL
     proxy-opentracing-enabled: false
     proxy-hint-enabled: false
     query-with-cipher-column: true
     sql-show: true
     check-table-metadata-enabled: false
   
   config-replica-query.yaml
   schemaName: replica_query_db
   
   dataSourceCommon:
     username: root
     password: 123456
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
     maxPoolSize: 50
     minPoolSize: 1
     maintenanceIntervalMilliseconds: 30000
   
   dataSources:
     primary_ds:
       url: 
jdbc:mysql://127.0.0.1:3306/demo_primary_ds?serverTimezone=UTC&useSSL=false
     replica_ds_0:
       url: 
jdbc:mysql://127.0.0.1:3306/demo_replica_ds_0?serverTimezone=UTC&useSSL=false
   
   rules:
     - !REPLICA_QUERY
       dataSources:
         primary_ds:
           name: primary_ds
           primaryDataSourceName: primary_ds
           replicaDataSourceNames:
             - replica_ds_0
   ### 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:
[email protected]


Reply via email to