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/02/11 07:04:12 UTC

[GitHub] [incubator-shardingsphere] mylyed opened a new issue #4236: sharing-proxy can't suport mysql 'longblob' data type

mylyed opened a new issue #4236: sharing-proxy can't suport  mysql 'longblob'  data type
URL: https://github.com/apache/incubator-shardingsphere/issues/4236
 
 
   
   ### Which version of ShardingSphere did you use?
   4.0.0-RC3
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   4.0.0-RC3
   ### Expected behavior
   INSERT success
   ![image](https://user-images.githubusercontent.com/11626016/74216300-f24ffb00-4cde-11ea-8873-d5a1a595c6a1.png)
   
   ### Actual behavior
   INSERT error
   ![image](https://user-images.githubusercontent.com/11626016/74216316-fed45380-4cde-11ea-93ab-42a5418d07d5.png)
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   the code
   '''java
   class JDBCTest {
       public static void main(String[] args) {
   //        HikariConfig config2 = new HikariDataSource();
   //        config2.setUsername("root");
   //        config2.setPassword("root");
   //        config2.setJdbcUrl("jdbc:mysql://172.21.16.98:3307/sharding_db");
   //        config2.setDriverClassName("com.mysql.jdbc.Driver");
   //        HikariDataSource from = new HikariDataSource(config2);
   
           HikariConfig config = new HikariDataSource();
           config.username = "dev";
           config.setPassword("21758E78331B20E4");
           config.setJdbcUrl("jdbc:mysql://172.21.16.52:3306/kxl_invoice");
           config.setDriverClassName("com.mysql.jdbc.Driver");
           HikariDataSource from = new HikariDataSource(config);
   
   
           new Sql(from.getConnection()).executeInsert("""
   
   INSERT INTO `kxl_invoice`.`kxl_verify_batch` (
   \t`id`,
   \t`company_id`,
   \t`user_id`,
   \t`batch_num`,
   \t`type`,
   \t`status`,
   \t`faild_desc`,
   \t`action_duration`,
   \t`retry_count`,
   \t`execute_time`,
   \t`is_deleted`,
   \t`create_time`,
   \t`update_time`
   )
   VALUES
   \t(
   \t\t'123',
   \t\t'3180bdf1-a44f-4bd9-83a1-d49dff39f141',
   \t\tNULL,
   \t\t'789c4df3dd134d7e81977e038e108f3b',
   \t\t'1',
   \t\t'3',
   \t\t'[Ã\u0083¦Ã\u0082Â\u009FÃ\u0082Â¥Ã\u0083©Ã\u0082ªÃ\u0082Â\u008CÃ\u0083Â¥Ã\u0082¤Ã\u0082±Ã\u0083¨Ã\u0082´Ã\u0082Â¥],[æÂ\u009F¥éªÂ\u008C失败],[æ ¡éª\u008Cç \u0081æ ¼å¼\u008Fæ\u009C\u0089误ï¼\u0081],[校验码格式有误!]',
   \t\t'111.45',
   \t\t'3',
   \t\t'2020-01-10 18:28:26',
   \t\t'0',
   \t\t'2020-01-10 18:21:04',
   \t\t'2020-01-10 18:28:26'
   \t);
   
   """);
   
       }
   }
   '''
   the table desc
   '''sql
   CREATE TABLE `kxl_verify_batch` (
     `id` bigint(1) NOT NULL COMMENT '主键',
     `company_id` varchar(36) DEFAULT NULL COMMENT '公司id',
     `user_id` varchar(36) DEFAULT NULL COMMENT '用户id',
     `batch_num` varchar(32) NOT NULL COMMENT '批次号',
     `type` int(1) DEFAULT NULL COMMENT '查验类型,1-内部系统使用, 2-外部用户使用',
     `status` int(1) DEFAULT NULL COMMENT '查验状态; 0-未查验, 1-查验中,2-查验成功,3-查验失败',
     `faild_desc` longblob COMMENT '错误描述',
     `action_duration` decimal(10,2) DEFAULT NULL COMMENT '操作耗时,单位-秒',
     `retry_count` int(1) DEFAULT '0' COMMENT '重试次数, 最高3次',
     `execute_time` datetime DEFAULT NULL COMMENT '任务执行时间',
     `is_deleted` int(1) DEFAULT '0' COMMENT '是否删除, 0:未删除  1:已删除',
     `create_time` datetime DEFAULT NULL COMMENT '创建时间',
     `update_time` datetime DEFAULT NULL COMMENT '更新时间',
     PRIMARY KEY (`id`),
     KEY `pk_batch_num` (`batch_num`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='批量查验表';
   '''
   
   ### 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] kimmking commented on issue #4236: sharing-proxy can't suport mysql 'longblob' data type

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #4236: sharing-proxy can't suport  mysql 'longblob'  data type
URL: https://github.com/apache/incubator-shardingsphere/issues/4236#issuecomment-584517973
 
 
   blob type also has this problem.
   reproduce it:
   1. create a table with a blob type column:
   ```sql
   CREATE TABLE `testblob` (
     `id` bigint(1) NOT NULL,
     `descblob` blob,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
   ```
   2. insert a row by mysql-cli directly:
   ```
   mysql> insert into testblob values (1,'\u0083\u0083\u0083\u0083');
   Query OK, 1 row affected (0.01 sec)
   ```
   3. insert a row by proxy:
   ```
   insert into testblob values (1,'\u0083\u0083\u0083\u0083')
   [2020-02-11 15:55:30] [C1000][10002] 2Unknown exception: [null]
   ```
   And in proxy logs, an error can be found:
   ```
   [ERROR] 16:06:47.135 [ShardingSphere-Command-13] o.a.s.s.f.c.CommandExecutorTask - Exception occur:
   java.util.NoSuchElementException: null
   	at java.util.Collections$EmptyIterator.next(Collections.java:4189)
   	at org.apache.shardingsphere.sharding.route.engine.condition.engine.InsertClauseShardingConditionEngine.createShardingCondition(InsertClauseShardingConditionEngine.java:86)
   	at org.apache.shardingsphere.sharding.route.engine.condition.engine.InsertClauseShardingConditionEngine.createShardingConditions(InsertClauseShardingConditionEngine.java:65)
   	at org.apache.shardingsphere.sharding.route.engine.ShardingRouter.getShardingConditions(ShardingRouter.java:116)
   	at org.apache.shardingsphere.sharding.route.engine.ShardingRouter.route(ShardingRouter.java:87)
   	at org.apache.shardingsphere.core.shard.SimpleQueryShardingEngine.route(SimpleQueryShardingEngine.java:54)
   	at org.apache.shardingsphere.core.shard.BaseShardingEngine.executeRoute(BaseShardingEngine.java:109)
   	at org.apache.shardingsphere.core.shard.BaseShardingEngine.shard(BaseShardingEngine.java:91)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.StatementExecutorWrapper.doShardingRoute(StatementExecutorWrapper.java:85)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.StatementExecutorWrapper.route(StatementExecutorWrapper.java:71)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:87)
   	at org.apache.shardingsphere.shardingproxy.backend.text.query.QueryBackendHandler.execute(QueryBackendHandler.java:54)
   	at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:75)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:92)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   	at java.lang.Thread.run(Thread.java:748)
   ```
   
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] mylyed closed issue #4236: sharing-proxy can't suport mysql 'longblob' data type

Posted by GitBox <gi...@apache.org>.
mylyed closed issue #4236: sharing-proxy can't suport  mysql 'longblob'  data type
URL: https://github.com/apache/incubator-shardingsphere/issues/4236
 
 
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] mylyed commented on issue #4236: sharing-proxy can't suport mysql 'longblob' data type

Posted by GitBox <gi...@apache.org>.
mylyed commented on issue #4236: sharing-proxy can't suport  mysql 'longblob'  data type
URL: https://github.com/apache/incubator-shardingsphere/issues/4236#issuecomment-585626565
 
 
   sorry ,  ‘Blob ’ data type not shown by mysql client
    

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] kimmking edited a comment on issue #4236: sharing-proxy can't suport mysql 'longblob' data type

Posted by GitBox <gi...@apache.org>.
kimmking edited a comment on issue #4236: sharing-proxy can't suport  mysql 'longblob'  data type
URL: https://github.com/apache/incubator-shardingsphere/issues/4236#issuecomment-584517973
 
 
   blob type also has this bug.
   reproduce it:
   1. create a table with a blob type column:
   ```sql
   CREATE TABLE `testblob` (
     `id` bigint(1) NOT NULL,
     `descblob` blob,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
   ```
   2. insert a row by mysql-cli directly:
   ```
   mysql> insert into testblob values (1,'\u0083\u0083\u0083\u0083');
   Query OK, 1 row affected (0.01 sec)
   ```
   3. insert a row by proxy:
   ```
   insert into testblob values (1,'\u0083\u0083\u0083\u0083')
   [2020-02-11 15:55:30] [C1000][10002] 2Unknown exception: [null]
   ```
   And in proxy logs, an error can be found:
   ```
   [ERROR] 16:06:47.135 [ShardingSphere-Command-13] o.a.s.s.f.c.CommandExecutorTask - Exception occur:
   java.util.NoSuchElementException: null
   	at java.util.Collections$EmptyIterator.next(Collections.java:4189)
   	at org.apache.shardingsphere.sharding.route.engine.condition.engine.InsertClauseShardingConditionEngine.createShardingCondition(InsertClauseShardingConditionEngine.java:86)
   	at org.apache.shardingsphere.sharding.route.engine.condition.engine.InsertClauseShardingConditionEngine.createShardingConditions(InsertClauseShardingConditionEngine.java:65)
   	at org.apache.shardingsphere.sharding.route.engine.ShardingRouter.getShardingConditions(ShardingRouter.java:116)
   	at org.apache.shardingsphere.sharding.route.engine.ShardingRouter.route(ShardingRouter.java:87)
   	at org.apache.shardingsphere.core.shard.SimpleQueryShardingEngine.route(SimpleQueryShardingEngine.java:54)
   	at org.apache.shardingsphere.core.shard.BaseShardingEngine.executeRoute(BaseShardingEngine.java:109)
   	at org.apache.shardingsphere.core.shard.BaseShardingEngine.shard(BaseShardingEngine.java:91)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.StatementExecutorWrapper.doShardingRoute(StatementExecutorWrapper.java:85)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.StatementExecutorWrapper.route(StatementExecutorWrapper.java:71)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:87)
   	at org.apache.shardingsphere.shardingproxy.backend.text.query.QueryBackendHandler.execute(QueryBackendHandler.java:54)
   	at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:75)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:92)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   	at java.lang.Thread.run(Thread.java:748)
   ```
   
   

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


With regards,
Apache Git Services