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/01/14 08:31:08 UTC

[GitHub] [shardingsphere] lizhuangs opened a new issue #9027: cant not work on mysql8 with json type

lizhuangs opened a new issue #9027:
URL: https://github.com/apache/shardingsphere/issues/9027


   ### table
   ```
   CREATE TABLE `site_flow_bandwidth`  (
     `id` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
     `flow_id` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
     `detail` json NULL,
     PRIMARY KEY (`id`) USING BTREE,
     UNIQUE INDEX `uq_flow`(`flow_id`) USING BTREE
   )
   ```
   
   ### test data
   ```
   INSERT INTO `site_flow_bandwidth`(`id`, `flow_id`, `detail`) VALUES ('1b100s1', '1f100s1', '{\"0\": \"1.0\", \"1\": \"1.0\", \"2\": \"1.0\", \"3\": \"1.0\", \"4\": \"1.0\", \"5\": \"1.0\"');
   INSERT INTO `site_flow_bandwidth`(`id`, `flow_id`, `detail`) VALUES ('1b100s10', '1f100s10', '{\"0\": \"1.0\", \"1\": \"1.0\", \"2\": \"1.0\", \"3\": \"1.0\", \"4\": \"1.0\", \"5\": \"1.0\"');
   INSERT INTO `site_flow_bandwidth`(`id`, `flow_id`, `detail`) VALUES ('1b100s100', '1f100s100', '{\"0\": \"1.0\", \"1\": \"1.0\", \"2\": \"1.0\", \"3\": \"1.0\", \"4\": \"1.0\", \"5\": \"1.0\"');
   INSERT INTO `site_flow_bandwidth`(`id`, `flow_id`, `detail`) VALUES ('1b100s1000', '1f100s1000', '{\"0\": \"1.0\", \"1\": \"1.0\", \"2\": \"1.0\", \"3\": \"1.0\", \"4\": \"1.0\", \"5\": \"1.0\"');
   INSERT INTO `site_flow_bandwidth`(`id`, `flow_id`, `detail`) VALUES ('1b100s101', '1f100s101', '{\"0\": \"1.0\", \"1\": \"1.0\", \"2\": \"1.0\", \"3\": \"1.0\", \"4\": \"1.0\", \"5\": \"1.0\"');
   ```
   
   ### sql 
   it works well in navicat,but can not work with shardingsphere
   ```
   SELECT
   	sum( detail -> '$.\"0\"' ), sum( detail -> '$.\"1\"' ), sum( detail -> '$.\"2\"' ) 
   FROM
   	site_flow_bandwidth 
   WHERE
   	id LIKE '1b100%'
   ```
   
   ### the error msg
   ```
   java.lang.NullPointerException: null
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.MySQLVisitor.visitPredicate(MySQLVisitor.java:315) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.MySQLVisitor.visitPredicate(MySQLVisitor.java:121) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$PredicateContext.accept(MySQLStatementParser.java:11690) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	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.mysql.visitor.MySQLVisitor.visitBooleanPrimary(MySQLVisitor.java:273) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.MySQLVisitor.visitBooleanPrimary(MySQLVisitor.java:121) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$BooleanPrimaryContext.accept(MySQLStatementParser.java:11463) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	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.mysql.visitor.MySQLVisitor.visitExpr(MySQLVisitor.java:258) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.MySQLVisitor.visitExpr(MySQLVisitor.java:121) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ExprContext.accept(MySQLStatementParser.java:11241) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	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.mysql.visitor.impl.MySQLDMLVisitor.createProjection(MySQLDMLVisitor.java:446) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitProjection(MySQLDMLVisitor.java:434) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitProjection(MySQLDMLVisitor.java:127) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ProjectionContext.accept(MySQLStatementParser.java:5370) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	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.mysql.visitor.impl.MySQLDMLVisitor.visitProjections(MySQLDMLVisitor.java:410) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitProjections(MySQLDMLVisitor.java:127) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ProjectionsContext.accept(MySQLStatementParser.java:4865) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	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.mysql.visitor.impl.MySQLDMLVisitor.visitSelectClause(MySQLDMLVisitor.java:329) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitSelectClause(MySQLDMLVisitor.java:127) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$SelectClauseContext.accept(MySQLStatementParser.java:4551) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	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.mysql.visitor.impl.MySQLDMLVisitor.visitUnionClause(MySQLDMLVisitor.java:322) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitUnionClause(MySQLDMLVisitor.java:127) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$UnionClauseContext.accept(MySQLStatementParser.java:4446) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	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.mysql.visitor.impl.MySQLDMLVisitor.visitSelect(MySQLDMLVisitor.java:314) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitSelect(MySQLDMLVisitor.java:127) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$SelectContext.accept(MySQLStatementParser.java:3098) ~[shardingsphere-sql-parser-mysql-4.1.1.jar:4.1.1]
   	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.SQLParserEngine.parse0(SQLParserEngine.java:80) ~[shardingsphere-sql-parser-engine-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61) ~[shardingsphere-sql-parser-engine-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.createRouteContext(DataNodeRouter.java:97) ~[shardingsphere-route-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:89) ~[shardingsphere-route-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76) ~[shardingsphere-route-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.pluggble.prepare.PreparedQueryPrepareEngine.route(PreparedQueryPrepareEngine.java:54) ~[shardingsphere-pluggable-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96) ~[shardingsphere-pluggable-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83) ~[shardingsphere-pluggable-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.prepare(ShardingPreparedStatement.java:183) ~[sharding-jdbc-core-4.1.1.jar:4.1.1]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:143) ~[sharding-jdbc-core-4.1.1.jar:4.1.1]
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.5.6.jar:3.5.6]
   	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 org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) ~[mybatis-3.5.6.jar:3.5.6]
   	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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at com.sun.proxy.$Proxy58.selectList(Unknown Source) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152) ~[mybatis-3.5.6.jar:3.5.6]
   	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) ~[mybatis-3.5.6.jar:3.5.6]
   	at com.sun.proxy.$Proxy61.selectTotalFlowByDate(Unknown Source) ~[na:na]
   	at com.oujiong.service.impl.SiteFlowBandWidthServiceImpl.selectTotalFlowByDate(SiteFlowBandWidthServiceImpl.java:30) ~[classes/:na]
   ```


----------------------------------------------------------------
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 #9027: cant not work on mysql8 with json type

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


   @lizhuangs Which version do you use?


----------------------------------------------------------------
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 closed issue #9027: cant not work on mysql8 with json type

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


   


-- 
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 #9027: cant not work on mysql8 with json type

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


   This problem had been fixed on branch master with this [pr](https://github.com/apache/shardingsphere/pull/11414).


-- 
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] jingshanglu removed a comment on issue #9027: cant not work on mysql8 with json type

Posted by GitBox <gi...@apache.org>.
jingshanglu removed a comment on issue #9027:
URL: https://github.com/apache/shardingsphere/issues/9027#issuecomment-764435599


   @lizhuangs Which version do you use?


----------------------------------------------------------------
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] chenqin091017 commented on issue #9027: cant not work on mysql8 with json type

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


   > @lizhuangs It has been fixed, new version will be ok.
   
   Hi All ,
   
   ShardingSphere Version 5.0.0-beta still has same bug.
   Could you solve this issue?
   In addition, why does load information from all tables when my project start?Other tables don't use ShardingSphere.
   ![QQ20210626-165352](https://user-images.githubusercontent.com/17311435/123507945-1ecfa180-d69f-11eb-99c2-d9a72d94c911.png)
   


-- 
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] flypiggy-stack commented on issue #9027: cant not work on mysql8 with json type

Posted by GitBox <gi...@apache.org>.
flypiggy-stack commented on issue #9027:
URL: https://github.com/apache/shardingsphere/issues/9027#issuecomment-876233182


   The Maven I quoted is this
   `<dependency>
       <groupId>org.apache.shardingsphere</groupId>
       <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
     </dependency>
     <dependency>
         <groupId>org.apache.shardingsphere</groupId>
         <artifactId>sharding-core-common</artifactId>
     </dependency>`
   
   Which version number should I refer to to solve this problem?
   
   


-- 
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] jingshanglu removed a comment on issue #9027: cant not work on mysql8 with json type

Posted by GitBox <gi...@apache.org>.
jingshanglu removed a comment on issue #9027:
URL: https://github.com/apache/shardingsphere/issues/9027#issuecomment-764435599


   @lizhuangs Which version do you use?


----------------------------------------------------------------
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] chenqin091017 removed a comment on issue #9027: cant not work on mysql8 with json type

Posted by GitBox <gi...@apache.org>.
chenqin091017 removed a comment on issue #9027:
URL: https://github.com/apache/shardingsphere/issues/9027#issuecomment-868972167


   > @lizhuangs It has been fixed, new version will be ok.
   
   Hi All ,
   
   ShardingSphere Version 5.0.0-beta still has same bug.
   Could you solve this issue?
   In addition, why does load information from all tables when my project start?Other tables don't use ShardingSphere.
   ![QQ20210626-165352](https://user-images.githubusercontent.com/17311435/123507945-1ecfa180-d69f-11eb-99c2-d9a72d94c911.png)
   


-- 
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] jingshanglu commented on issue #9027: cant not work on mysql8 with json type

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






----------------------------------------------------------------
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 #9027: cant not work on mysql8 with json type

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


   Fixed by #11414.


-- 
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] jingshanglu commented on issue #9027: cant not work on mysql8 with json type

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


   @lizhuangs It has been fixed, new version will be ok.


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