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 2022/06/03 20:46:32 UTC

[GitHub] [shardingsphere] imjcoder opened a new issue, #18170: 分库分表关联查询,部分数据出不来

imjcoder opened a new issue, #18170:
URL: https://github.com/apache/shardingsphere/issues/18170

   **### 请大佬帮忙看看哈 万分感谢**
   按照order_id进行查询,order_id是奇数的时候,只能查询出来奇数的t_order_item中的数据,反之偶数也只能查询出偶数数据
   弄到半夜5点也没有搞定,官网能不能多提供一些例子哈?
   
   我把代码已经上传到百度云了,GitHub上面传不上。。。。
   
   链接: https://pan.baidu.com/s/1DCXW14UtLdby6lI5ELLqzw?pwd=btch 提取码: btch 
   
   第三个例子,中的测试代码,根据order_id查询、分页查询的时候,子表的数据都是不准确的。。
   
   表结构如下:
   `
   SET FOREIGN_KEY_CHECKS=0;
   
   -- ----------------------------
   -- Table structure for t_order0
   -- ----------------------------
   DROP TABLE IF EXISTS `t_order0`;
   CREATE TABLE `t_order0` (
     `order_id` bigint NOT NULL COMMENT '主键ID',
     `add_time` date DEFAULT NULL COMMENT '入库时间',
     `user_id` bigint DEFAULT NULL COMMENT '用户ID',
     `order_no` varchar(100) DEFAULT NULL COMMENT '订单编号',
     PRIMARY KEY (`order_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单表';
   
   -- ----------------------------
   -- Table structure for t_order1
   -- ----------------------------
   DROP TABLE IF EXISTS `t_order1`;
   CREATE TABLE `t_order1` (
     `order_id` bigint NOT NULL COMMENT '主键ID',
     `add_time` date DEFAULT NULL COMMENT '入库时间',
     `user_id` bigint DEFAULT NULL COMMENT '用户ID',
     `order_no` varchar(100) DEFAULT NULL COMMENT '订单编号',
     PRIMARY KEY (`order_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单表';
   
   -- ----------------------------
   -- Table structure for t_order2
   -- ----------------------------
   DROP TABLE IF EXISTS `t_order2`;
   CREATE TABLE `t_order2` (
     `order_id` bigint NOT NULL COMMENT '主键ID',
     `add_time` date DEFAULT NULL COMMENT '入库时间',
     `user_id` bigint DEFAULT NULL COMMENT '用户ID',
     `order_no` varchar(100) DEFAULT NULL COMMENT '订单编号',
     PRIMARY KEY (`order_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单表';
   
   -- ----------------------------
   -- Table structure for t_order3
   -- ----------------------------
   DROP TABLE IF EXISTS `t_order3`;
   CREATE TABLE `t_order3` (
     `order_id` bigint NOT NULL COMMENT '主键ID',
     `add_time` date DEFAULT NULL COMMENT '入库时间',
     `user_id` bigint DEFAULT NULL COMMENT '用户ID',
     `order_no` varchar(100) DEFAULT NULL COMMENT '订单编号',
     PRIMARY KEY (`order_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单表';`


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] xinglijun1973 commented on issue #18170: Association query sub table data cannot be exported

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

   what's your expected and actual ?


-- 
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 #18170: Association query sub table data cannot be exported

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

   Closed because of no feedback


-- 
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 closed issue #18170: Association query sub table data cannot be exported

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #18170: Association query sub table data cannot be exported
URL: https://github.com/apache/shardingsphere/issues/18170


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