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/06 09:21:18 UTC

[GitHub] [shardingsphere] qifengzhang007 opened a new issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

qifengzhang007 opened a new issue #8051:
URL: https://github.com/apache/shardingsphere/issues/8051


   ### 问题描述:两个表连接查询结果不正确!
   
   ### 当前软件以及版本  sharding-proxy  4.1.1
   
   
   ### 主要配置参数
   ```code
   shardingRule:
     tables:
       # 表名: t_order
       tb_order:
         actualDataNodes: ds_${0..1}.tb_order_${0..1}
         # table 表的行内规则
         tableStrategy:
           inline:
             #分表字段,开发者生成
             shardingColumn: order_id
             #算法, order_id 是偶数,就存入  t_order_0 表
             algorithmExpression: tb_order_${order_id % 2}
         #主键生成规则:雪花算法+该表(t_order)的主键:id   ,id 字段会自动生成
         keyGenerator:
           type: SNOWFLAKE
           column: id
       tb_order_item:
         actualDataNodes: ds_${0..1}.tb_order_item_${0..3}
         tableStrategy:
           inline:
             # t_order_item 表的数据就是t_order表的明细数据,两个表的关联键是  order_id
             shardingColumn: order_id
             algorithmExpression: tb_order_item_${order_id % 4}
         #主键生成规则:雪花算法+该表(t_order_item)的主键:id ,字段会自动生成
         keyGenerator:
           type: SNOWFLAKE
           column: id
     #设置哪些表需要分库分表
     bindingTables:
       - tb_order,tb_order_item
     #数据源配置策略  
     defaultDatabaseStrategy:
       inline:
         #一般来说,订单表中数据的产生和操作员(用户id)user_id 绑定,如果用户id时偶数,就寻找 ds_0 数据源对应的数据库
         shardingColumn: id
         algorithmExpression: ds_${id % 2}
     defaultTableStrategy:
       none:
   
   ```
   
   ### 问题复现步骤
   ```code
   SELECT  *  FROM  tb_order  WHERE   order_id=20201106001 ;
   -- 查询结果会有1条数据
   "id"	"order_id"	"order_name"	"status"	"remark"	"created_at"	"updated_at"
   "531493101638778884"	"20201106001"	"双11订单测试001"	"1"	"订单主表001"	"2020-11-06 15:23:50"	"2020-11-06 15:23:50"
   
   SELECT  *  FROM  tb_order_item   WHERE   order_id=20201106001;
   -- 查询结果会有2条数据
   "id"	"order_id"	"item_name"	"price"	"num"	"total_price"	"status"	"remark"	"created_at"	"updated_at"
   "531498964927643648"	"20201106001"	"小米手10"	"2.00"	"4999"	"9998.00"	"1"	"小米手机白色版"	"2020-11-06 15:47:08"	"2020-11-06 15:47:08"
   "531499009353711617"	"20201106001"	"小米手10 至尊版"	"2.00"	"4999"	"9998.00"	"1"	"小米手机至尊版"	"2020-11-06 15:47:18"	"2020-11-06 15:47:18"
   
   
   sql表关联查询之后,只有一条数据,而且还是字段被合并在一行了?什么奇葩问题?
   SELECT  *  FROM    tb_order  a  LEFT  JOIN   tb_order_item  b  ON  a.order_id=b.order_id   WHERE   a.order_id=20201106001
   #查询结果错误,被合并成了一行,而且只有一条数据!
   "id"	"order_id"	"order_name"	"status"	"remark"	"created_at"	"updated_at"	"id"	"order_id"	"item_name"	"price"	"num"	"total_price"	"status"	"remark"	"created_at"	"updated_at"
   "531493101638778884"	"20201106001"	"双11订单测试001"	"1"	"订单主表001"	"2020-11-06 15:23:50"	"2020-11-06 15:23:50"	"531498964927643648"	"20201106001"	"小米手10"	"2.00"	"4999"	"9998.00"	"1"	"小米手机白色版"	"2020-11-06 15:47:08"	"2020-11-06 15:47:08"
   ```


----------------------------------------------------------------
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] kimmking commented on issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

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


   @qifengzhang007 binding tables MUST BE the same sharding rule!


----------------------------------------------------------------
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] thicv commented on issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

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


   根本不看规矩啊,首先是英文回复,其次 shardingsphere 是付费软件吗?那么多人日以继夜的新增功能改 bug,你给了一分钱?opensource 就活该让你这么说话?最后你要是行,你就改了提 PR 啊。小屁孩你爸妈没有教你怎么跟别人说话吗,是不是缺少社会的毒打?


----------------------------------------------------------------
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] thicv edited a comment on issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

Posted by GitBox <gi...@apache.org>.
thicv edited a comment on issue #8051:
URL: https://github.com/apache/shardingsphere/issues/8051#issuecomment-723018870


   @qifengzhang007  根本不看规矩啊,首先必须是英文回复,这不是 shardingsphere 或者国内的规矩,这是 Apache 的规矩,其次 shardingsphere 是付费软件吗?那么多人日以继夜的新增功能改 bug,你给了一分钱,拿来就用就得拿来就喷?opensource 就得让你这么说话?最后你要是行,你就改了提 PR 啊。小屁孩你爸妈没有教你怎么跟别人说话吗,是不是缺少社会的毒打?


----------------------------------------------------------------
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] terrymanu closed issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

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


   


----------------------------------------------------------------
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] autumnbz removed a comment on issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

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


   水平一般,脾气真大。


-- 
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] terrymanu commented on issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

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


   **For English only**, other languages will not accept.


----------------------------------------------------------------
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] thicv edited a comment on issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

Posted by GitBox <gi...@apache.org>.
thicv edited a comment on issue #8051:
URL: https://github.com/apache/shardingsphere/issues/8051#issuecomment-723018870


   根本不看规矩啊,首先必须是英文回复,这不是 shardingsphere 或者国内的规矩,这是 Apache 的规矩,其次 shardingsphere 是付费软件吗?那么多人日以继夜的新增功能改 bug,你给了一分钱,拿来就用就得拿来就喷?opensource 就得让你这么说话?最后你要是行,你就改了提 PR 啊。小屁孩你爸妈没有教你怎么跟别人说话吗,是不是缺少社会的毒打?


----------------------------------------------------------------
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] autumnbz commented on issue #8051: sharding-proxy到底有没有人用?为什么这么多bug?

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


   水平一般,脾气真大。


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