cay914 opened a new issue #6830:
URL: https://github.com/apache/shardingsphere/issues/6830


   @kimmking @tuohai666 Hi, I have that Navicat 11 has some bug that make 
sharding-proxy wrong.
   I think this is good reason to support navcat 15.
   
   when I search on the order_id column which is bigint in database, and I get 
the flowing error.
   
![image](https://user-images.githubusercontent.com/6037435/90174216-37f99780-ddd8-11ea-9f8d-eda6443b09cd.png)
   
![image](https://user-images.githubusercontent.com/6037435/90174233-3def7880-ddd8-11ea-9a09-9e34dc4a6cf2.png)
   
   t_order DLL:
   CREATE TABLE `t_order` (
     `order_id` bigint(20) NOT NULL COMMENT '订单id',
     `user_id` bigint(20) NOT NULL,
     `coupon_id` bigint(20) DEFAULT NULL,
     `create_time` datetime DEFAULT NULL COMMENT '提交时间',
     `member_username` varchar(512) DEFAULT NULL COMMENT '用户帐号',
     `total_amount` decimal(10,2) DEFAULT NULL COMMENT '订单总金额',
     `pay_amount` decimal(10,2) DEFAULT '0.00' COMMENT '应付金额(实际支付金额)',
     `freight_amount` decimal(10,2) DEFAULT NULL COMMENT '运费金额',
     `promotion_amount` decimal(10,2) DEFAULT NULL COMMENT '促销优化金额(促销价、满减、阶梯价)',
     `integration_amount` decimal(10,2) DEFAULT NULL COMMENT '积分抵扣金额',
     `coupon_amount` decimal(10,2) DEFAULT NULL COMMENT '优惠券抵扣金额',
     `discount_amount` decimal(10,2) DEFAULT NULL COMMENT '管理员后台调整订单使用的折扣金额',
     `pay_type` int(11) DEFAULT NULL COMMENT '支付方式:0->未支付;1->支付宝;2->微信',
     `source_type` int(11) DEFAULT NULL COMMENT '订单来源:0->PC订单;1->app订单',
     `status` int(11) DEFAULT NULL COMMENT 
'订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单',
     `order_type` int(11) DEFAULT NULL COMMENT '订单类型:0->正常订单;1->秒杀订单',
     `delivery_company` varchar(64) DEFAULT NULL COMMENT '物流公司(配送方式)',
     `delivery_sn` varchar(64) DEFAULT NULL COMMENT '物流单号',
     `auto_confirm_day` int(11) DEFAULT NULL COMMENT '自动确认时间(天)',
     `integration` int(11) DEFAULT NULL COMMENT '可以获得的积分',
     `growth` int(11) DEFAULT NULL COMMENT '可以活动的成长值',
     `promotion_info` varchar(100) DEFAULT NULL COMMENT '活动信息',
     `bill_type` int(11) DEFAULT NULL COMMENT '发票类型:0->不开发票;1->电子发票;2->纸质发票',
     `bill_header` varchar(200) DEFAULT NULL COMMENT '发票抬头',
     `bill_content` varchar(200) DEFAULT NULL COMMENT '发票内容',
     `bill_receiver_phone` varchar(32) DEFAULT NULL COMMENT '收票人电话',
     `bill_receiver_email` varchar(64) DEFAULT NULL COMMENT '收票人邮箱',
     `receiver_name` varchar(100) DEFAULT NULL COMMENT '收货人姓名',
     `receiver_phone` varchar(32) DEFAULT NULL COMMENT '收货人电话',
     `receiver_post_code` varchar(32) DEFAULT NULL COMMENT '收货人邮编',
     `receiver_province` varchar(32) DEFAULT NULL COMMENT '省份/直辖市',
     `receiver_city` varchar(32) DEFAULT NULL COMMENT '城市',
     `receiver_region` varchar(32) DEFAULT NULL COMMENT '区',
     `receiver_detail_address` varchar(200) DEFAULT NULL COMMENT '详细地址',
     `note` varchar(500) DEFAULT NULL COMMENT '订单备注',
     `confirm_status` int(11) DEFAULT NULL COMMENT '确认收货状态:0->未确认;1->已确认',
     `delete_status` int(11) NOT NULL DEFAULT '0' COMMENT '删除状态:0->未删除;1->已删除',
     `use_integration` int(11) DEFAULT NULL COMMENT '下单时使用的积分',
     `payment_time` datetime DEFAULT NULL COMMENT '支付时间',
     `delivery_time` datetime DEFAULT NULL COMMENT '发货时间',
     `receive_time` datetime DEFAULT NULL COMMENT '确认收货时间',
     `comment_time` datetime DEFAULT NULL COMMENT '评价时间',
     `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
     `prepay_id` varchar(255) DEFAULT NULL,
     `supply_id` bigint(20) DEFAULT NULL,
     `goods_id` bigint(20) DEFAULT NULL,
     `goods_name` varchar(255) DEFAULT NULL,
     `school_id` bigint(20) DEFAULT NULL,
     `store_id` int(11) DEFAULT '1' COMMENT '所属店铺',
     `receiver_id` bigint(20) DEFAULT NULL,
     `group_id` bigint(20) DEFAULT NULL,
     `tax_type` smallint(6) DEFAULT '1' COMMENT '是否开发票 1=不发票 2=个人发票 3=公司发票',
     `tax_content` varchar(255) CHARACTER SET utf8mb4 DEFAULT '商品详情' COMMENT 
'发票内容',
     `tax_code` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '税号',
     `tax_title` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '发票抬头',
     `is_comment` tinyint(3) unsigned DEFAULT NULL COMMENT '是否评论,1未评论,2已评论',
     `store_name` varchar(255) DEFAULT NULL,
     `pid` bigint(20) DEFAULT NULL,
     `vip_amount` decimal(10,0) DEFAULT '0',
     `update_time` datetime DEFAULT NULL COMMENT '注册时间',
     PRIMARY KEY (`order_id`) USING BTREE
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='订单表';
   
   **data:**
   INSERT INTO `t_order` VALUES ('4043', '297', null, '2020-04-10 21:45:51', 
'13146587722', '169.00', '169.00', '0.00', '0.00', '0.00', '0.00', '0.00', '1', 
'1', '4', '1', null, null, null, '0', null, null, null, null, null, null, null, 
'gd', '13123456789', null, '北京市', '市辖区', '西城区', '222', null, '0', '0', null, 
'2020-04-11 08:45:36', null, null, null, null, null, null, '178', '铸铁珐琅牛排煎锅', 
null, '1', '173', null, '1', '商品详情', null, null, '1', null, null, '0', null);
   
   **config-sharding.yaml:**
   schemaName: sharding_db
   dataSources:
     order0:
       url: jdbc:mysql://localhost:3306/order0?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
     order1:
       url: jdbc:mysql://localhost:3306/order1?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
   shardingRule:
     tables:
       t_order:
         actualDataNodes: order0.t_order_$->{[0,1,2,3]}, 
order1.t_order_$->{[0,1,2,3]}
         databaseStrategy:
           inline:
             shardingColumn: user_id
             algorithmExpression: order${user_id % 2}
         tableStrategy:
           inline:
             shardingColumn: order_id
             algorithmExpression: t_order_$->{order_id % 4}
       t_order_item:
         actualDataNodes: order0.t_order_item_$->{[0,1,2,3]}, 
order1.t_order_item_$->{[0,1,2,3]}
         databaseStrategy:
           inline:
             shardingColumn: user_id
             algorithmExpression: order${user_id % 2}
         tableStrategy:
           inline:
             shardingColumn: order_id
             algorithmExpression: t_order_item_$->{order_id % 4}
     bindingTables:
       - t_order, t_order_item
     defaultTableStrategy:
       none:
   
   
   **Log on sharding-proxy:**
   [ERROR] 02:49:33.844 [ShardingSphere-Command-2] 
o.a.s.s.f.c.CommandExecutorTask - Exception occur: 
   groovy.lang.MissingMethodException: No signature of method: 
java.lang.String.mod() is applicable for argument types: (java.lang.Integer) 
values: [4]
   Possible solutions: drop(int), find(), any(), any(groovy.lang.Closure), 
find(groovy.lang.Closure), find(java.lang.CharSequence)
           at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
           at 
org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:49)
           at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
           at Script4$_run_closure1.doCall(Script4.groovy:1)
           at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
           at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
           at 
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
           at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
           at groovy.lang.Closure.call(Closure.java:426)
           at groovy.lang.Closure.call(Closure.java:420)
           at 
org.apache.shardingsphere.core.strategy.route.inline.InlineShardingStrategy.execute(InlineShardingStrategy.java:94)
           at 
org.apache.shardingsphere.core.strategy.route.inline.InlineShardingStrategy.doSharding(InlineShardingStrategy.java:76)
           at 
org.apache.shardingsphere.core.strategy.route.inline.InlineShardingStrategy.doSharding(InlineShardingStrategy.java:63)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeTables(ShardingStandardRoutingEngine.java:214)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route0(ShardingStandardRoutingEngine.java:195)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditionsWithCondition(ShardingStandardRoutingEngine.java:121)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditions(ShardingStandardRoutingEngine.java:115)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.getDataNodes(ShardingStandardRoutingEngine.java:96)
           at 
org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route(ShardingStandardRoutingEngine.java:74)
           at 
org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:69)
           at 
org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:53)
           at 
org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:91)
           at 
org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76)
           at 
org.apache.shardingsphere.underlying.pluggble.prepare.SimpleQueryPrepareEngine.route(SimpleQueryPrepareEngine.java:54)
           at 
org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96)
           at 
org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83)
           at 
org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.StatementExecutorWrapper.doShardingRoute(StatementExecutorWrapper.java:80)
           at 
org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.StatementExecutorWrapper.route(StatementExecutorWrapper.java:63)
           at 
org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:74)
           at 
org.apache.shardingsphere.shardingproxy.backend.text.query.QueryBackendHandler.execute(QueryBackendHandler.java:52)
           at 
org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:78)
           at 
org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:93)
           at 
org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           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:
[email protected]


Reply via email to