zihaoAK47 opened a new issue, #29415:
URL: https://github.com/apache/shardingsphere/issues/29415

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   
![exeresult](https://github.com/apache/shardingsphere/assets/106047330/106b1d7c-2f12-469f-8200-416833499cc0)
   
   ### Actual behavior
   ```
   [ERROR] 2023-12-15 17:08:16.593 [ShardingSphere-Command-0] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.ClassCastException: class 
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.NotExpression 
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.NotExpression 
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.MySQLStatementVisitor.createProjection(MySQLStatementVisitor.java:1775)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitProjection(MySQLStatementVisitor.java:1705)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitProjection(MySQLStatementVisitor.java:251)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ProjectionContext.accept(MySQLStatementParser.java:24357)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitProjections(MySQLStatementVisitor.java:1671)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitProjections(MySQLStatementVisitor.java:251)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ProjectionsContext.accept(MySQLStatementParser.java:23714)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitQuerySpecification(MySQLStatementVisitor.java:798)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitQuerySpecification(MySQLStatementVisitor.java:251)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QuerySpecificationContext.accept(MySQLStatementParser.java:21978)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementBaseVisitor.visitQueryPrimary(MySQLStatementBaseVisitor.java:1399)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryPrimaryContext.accept(MySQLStatementParser.java:21895)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitQueryExpressionBody(MySQLStatementVisitor.java:761)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitQueryExpressionBody(MySQLStatementVisitor.java:251)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionBodyContext.accept(MySQLStatementParser.java:21608)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitQueryExpression(MySQLStatementVisitor.java:709)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitQueryExpression(MySQLStatementVisitor.java:251)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$QueryExpressionContext.accept(MySQLStatementParser.java:21518)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitSelect(MySQLStatementVisitor.java:1625)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.MySQLStatementVisitor.visitSelect(MySQLStatementVisitor.java:251)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$SelectContext.accept(MySQLStatementParser.java:21351)
        at 
org.apache.shardingsphere.sql.parser.api.SQLStatementVisitorEngine.visit(SQLStatementVisitorEngine.java:54)
        at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:47)
        at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:61)
        at 
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:52)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.parseSQL(MySQLComQueryPacketExecutor.java:80)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.<init>(MySQLComQueryPacketExecutor.java:68)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecutorFactory.newInstance(MySQLCommandExecutorFactory.java:84)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecuteEngine.getCommandExecutor(MySQLCommandExecuteEngine.java:63)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:120)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
        at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
   ```
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   Environmental configuration Ref: #28895
   ```
   select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0;
   ```
   


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