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/05/05 11:56:19 UTC

[GitHub] [shardingsphere] EverZxq opened a new issue #10254: ParameterMarkerValue cannot be cast to ExpressionSegment

EverZxq opened a new issue #10254:
URL: https://github.com/apache/shardingsphere/issues/10254


   shielding Fuzzy query is not ok, but annotation like is ok。
   
   Error context:
   
   SELECT COUNT( * ) FROM PROCESS_TASKS WHERE (TASK_TYPE = ? AND CURRENT_REVIEWER LIKE ?) 
   
   java.lang.ClassCastException: org.apache.shardingsphere.sql.parser.sql.common.value.parametermarker.ParameterMarkerValue cannot be cast to org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.createBinaryOperationExpressionFromLike(OracleStatementSQLVisitor.java:313) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitPredicate(OracleStatementSQLVisitor.java:288) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitPredicate(OracleStatementSQLVisitor.java:107) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$PredicateContext.accept(OracleStatementParser.java:6488) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitBooleanPrimary(OracleStatementSQLVisitor.java:263) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitBooleanPrimary(OracleStatementSQLVisitor.java:107) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$BooleanPrimaryContext.accept(OracleStatementParser.java:6264) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitExpr(OracleStatementSQLVisitor.java:235) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitExpr(OracleStatementSQLVisitor.java:107) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$ExprContext.accept(OracleStatementParser.java:6060) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitExpr(OracleStatementSQLVisitor.java:242) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitExpr(OracleStatementSQLVisitor.java:107) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$ExprContext.accept(OracleStatementParser.java:6060) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitExpr(OracleStatementSQLVisitor.java:238) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleStatementSQLVisitor.visitExpr(OracleStatementSQLVisitor.java:107) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$ExprContext.accept(OracleStatementParser.java:6060) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleDMLStatementSQLVisitor.visitWhereClause(OracleDMLStatementSQLVisitor.java:449) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleDMLStatementSQLVisitor.visitWhereClause(OracleDMLStatementSQLVisitor.java:102) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$WhereClauseContext.accept(OracleStatementParser.java:4112) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleDMLStatementSQLVisitor.visitSelectClause(OracleDMLStatementSQLVisitor.java:253) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleDMLStatementSQLVisitor.visitSelectClause(OracleDMLStatementSQLVisitor.java:102) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$SelectClauseContext.accept(OracleStatementParser.java:2730) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleDMLStatementSQLVisitor.visitUnionClause(OracleDMLStatementSQLVisitor.java:238) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleDMLStatementSQLVisitor.visitUnionClause(OracleDMLStatementSQLVisitor.java:102) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$UnionClauseContext.accept(OracleStatementParser.java:2637) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.7.2.jar:4.7.2]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleDMLStatementSQLVisitor.visitSelect(OracleDMLStatementSQLVisitor.java:230) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.oracle.visitor.statement.impl.OracleDMLStatementSQLVisitor.visitSelect(OracleDMLStatementSQLVisitor.java:102) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser$SelectContext.accept(OracleStatementParser.java:2586) ~[shardingsphere-sql-parser-oracle-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine.visit(SQLVisitorEngine.java:45) ~[shardingsphere-sql-parser-engine-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:65) ~[shardingsphere-infra-parser-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:59) ~[shardingsphere-infra-parser-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse0(ShardingSphereSQLParserEngine.java:74) ~[shardingsphere-infra-parser-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:60) ~[shardingsphere-infra-parser-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:142) ~[shardingsphere-jdbc-core-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:115) ~[shardingsphere-jdbc-core-5.0.0-alpha.jar:5.0.0-alpha]
   	at org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection.prepareStatement(ShardingSphereConnection.java:80) ~[shardingsphere-jdbc-core-5.0.0-alpha.jar:5.0.0-alpha]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
   	at org.apache.ibatis.logging.jdbc.ConnectionLogger.invoke(ConnectionLogger.java:55) ~[mybatis-3.5.6.jar:3.5.6]
   	at com.sun.proxy.$Proxy142.prepareStatement(Unknown Source) ~[?:?]
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:86) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59) ~[mybatis-3.5.6.jar:3.5.6]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
   	at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.6.jar:3.5.6]
   	at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:83) ~[mybatis-plus-extension-3.4.1.jar:3.4.1]
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.6.jar:3.5.6]
   	at com.sun.proxy.$Proxy245.prepare(Unknown Source) ~[?:?]
   	at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.prepareStatement(MybatisSimpleExecutor.java:94) ~[mybatis-plus-core-3.4.1.jar:3.4.1]
   	at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:68) ~[mybatis-plus-core-3.4.1.jar:3.4.1]
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.6.jar:3.5.6]
   	at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:165) ~[mybatis-plus-core-3.4.1.jar:3.4.1]
   	at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:65) ~[mybatis-plus-extension-3.4.1.jar:3.4.1]
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.6.jar:3.5.6]
   	at com.sun.proxy.$Proxy244.query(Unknown Source) ~[?:?]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76) ~[mybatis-3.5.6.jar:3.5.6]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ~[mybatis-spring-2.0.5.jar:2.0.5]
   	at com.sun.proxy.$Proxy150.selectOne(Unknown Source) ~[?:?]
   	at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:159) ~[mybatis-spring-2.0.5.jar:2.0.5]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:90) ~[mybatis-plus-core-3.4.1.jar:3.4.1]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) ~[mybatis-plus-core-3.4.1.jar:3.4.1]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.4.1.jar:3.4.1]


-- 
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 #10254: ParameterMarkerValue cannot be cast to ExpressionSegment

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


   @EverZxq Thank you very much for using version `5.0.0-alpha`, this is a parse exception, and we will fix this issue later.
   


-- 
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] EverZxq commented on issue #10254: ParameterMarkerValue cannot be cast to ExpressionSegment

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


   > @EverZxq非常感谢您使用version `5.0.0-alpha`,这是一个解析异常,我们将在以后解决此问题。
   
   When is the next version? Since our project has encountered this problem and cannot be solved, can we revert to the old version to solve 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 closed issue #10254: ParameterMarkerValue cannot be cast to ExpressionSegment

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


   


-- 
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 #10254: ParameterMarkerValue cannot be cast to ExpressionSegment

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


   @EverZxq It will take some time before the `5.0.0-beta` version is released. Please be patient and wait for the good news. You can temporarily use the following SQL: 
   
   ```sql
   SELECT COUNT( * ) FROM PROCESS_TASKS WHERE (TASK_TYPE = ? AND CURRENT_REVIEWER LIKE CONCAT('%%', ?, '%%'))
   ```


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