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 2020/11/24 16:25:17 UTC

[GitHub] [shardingsphere] lafaso opened a new issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

lafaso opened a new issue #8326:
URL: https://github.com/apache/shardingsphere/issues/8326


   version:4.0.0-RC3
   SQL:
      select count(*) from asset 
      where 1=1 and yn = 1
      <if test="guarantee != null and guarantee == 4">
   	AND (service_duration="" OR ISNULL(use_date) OR ISNULL(service_duration))
      </if>
   
   exception info :
   Caused by: org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: java.lang.ClassCastException: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext
   ### The error may exist in URL [jar:file:/Users/lizp/JDP/apache-tomcat-8.5.37/webapps/ROOT/WEB-INF/lib/dmall-asset-dao-1.0-SNAPSHOT.jar!/sqlmap/AssetMapper.xml]
   ### The error may involve assetMapper.countAsset-Inline
   ### The error occurred while setting parameters
   ### SQL: SELECT COUNT(*) FROM asset    WHERE 1=1                                                                                        and yn = ?                      AND (service_duration="" OR ISNULL(use_date) OR ISNULL(service_duration))
   ### Cause: java.lang.ClassCastException: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62) ~[mybatis-3.2.1.jar:3.2.1]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:354) ~[mybatis-spring-1.2.0.jar:1.2.0]
   	... 60 common frames omitted
   Caused by: java.lang.ClassCastException: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext
   	at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extractRecursiveWithParen(PredicateExtractor.java:83) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extractRecursiveWithLogicalOperation(PredicateExtractor.java:71) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extractRecursiveWithLogicalOperation(PredicateExtractor.java:74) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extractRecursiveWithLogicalOperation(PredicateExtractor.java:73) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extractRecursiveWithLogicalOperation(PredicateExtractor.java:73) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extract(PredicateExtractor.java:65) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.WhereExtractor.extract(WhereExtractor.java:48) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.core.extractor.SQLSegmentsExtractorEngine.extract(SQLSegmentsExtractorEngine.java:47) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.core.SQLParseKernel.parse(SQLParseKernel.java:62) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.SQLParseEngine.parse0(SQLParseEngine.java:71) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.parse.SQLParseEngine.parse(SQLParseEngine.java:53) ~[sharding-core-parse-common-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.route.router.sharding.ShardingRouter.parse(ShardingRouter.java:80) ~[sharding-core-route-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.route.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:61) ~[sharding-core-route-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.PreparedQueryShardingEngine.route(PreparedQueryShardingEngine.java:59) ~[sharding-core-entry-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.BaseShardingEngine.executeRoute(BaseShardingEngine.java:91) ~[sharding-core-entry-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.core.BaseShardingEngine.shard(BaseShardingEngine.java:74) ~[sharding-core-entry-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.shard(ShardingPreparedStatement.java:222) ~[sharding-jdbc-core-4.0.0-RC3.jar:4.0.0-RC3]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:163) ~[sharding-jdbc-core-4.0.0-RC3.jar:4.0.0-RC3]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
   	at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:55) ~[mybatis-3.2.1.jar:3.2.1]
   	at com.sun.proxy.$Proxy42.execute(Unknown Source) ~[na:na]
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:56) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:57) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) ~[mybatis-3.2.1.jar:3.2.1]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) ~[mybatis-3.2.1.jar:3.2.1]
   	... 67 common frames omitted
   
   This is the first time I've used this framework,please give a hand!tks!


----------------------------------------------------------------
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] jingshanglu commented on issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

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


   @lafaso Now `IF` is not yet supported, it will be fixed soon.


----------------------------------------------------------------
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] lafaso closed issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

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


   


----------------------------------------------------------------
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] jingshanglu commented on issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

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


   @lafaso The SQL also is illegal, i have run it on `MySQL 5.7` , the sql doesn't work.


----------------------------------------------------------------
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] jingshanglu commented on issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

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


   > SELECT COUNT(*) FROM asset WHERE 1=1 and yn = 1 AND (service_duration="" OR ISNULL(use_date) OR ISNULL(service_duration))
   
   @lafaso plz use `5.0.0-alpha`, it is ok on `5.0.0-alpha`. I have checked 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] strongduanmu commented on issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

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


   @lafaso Can you try the latest `5.0.0-alpha` version? 😀


----------------------------------------------------------------
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] lafaso commented on issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

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


   > @lafaso The SQL also is illegal, i have run it on `MySQL 5.7` , the sql doesn't work.
   
   @jingshanglu 
   ` SELECT COUNT(*) FROM asset    WHERE 1=1 and yn = 1 AND (service_duration="" OR ISNULL(use_date) OR ISNULL(service_duration))`
   
   this is the correct sql,there is a little problem previous sql. and it works on  `MySQL 5.7`
   


----------------------------------------------------------------
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] lafaso commented on issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

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


   > @lafaso Can you try the latest `5.0.0-alpha` version? 😀
   
   @strongduanmu 
   `<dependency>`
         `<groupId>org.apache.shardingsphere</groupId>`
         `<artifactId>sharding-jdbc-spring-namespace</artifactId>`
         `<version>${sharding-sphere.version}</version>`
   `</dependency>`
   only this dependency in my project, 5.0.0-alpha version seems not exists?


----------------------------------------------------------------
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] lafaso commented on issue #8326: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext from 4.0.0-RC3

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


   > > SELECT COUNT(*) FROM asset WHERE 1=1 and yn = 1 AND (service_duration="" OR ISNULL(use_date) OR ISNULL(service_duration))
   > 
   > @lafaso plz use `5.0.0-alpha`, it is ok on `5.0.0-alpha`. I have checked it.
   
   @jingshanglu i use 3.0.0.M1 and it works well!😄


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