zkzong opened a new issue #11072:
URL: https://github.com/apache/shardingsphere/issues/11072


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   4.1.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   When I use official example, I modify the code, doesn't use snowflake 
algorithm. I set primary key by myself.
   My code is like this:
   ```java
           for (int i = 1; i <= 10; i++) {
               Order order = new Order();
   
               order.setOrderId(i);
   
               order.setUserId(i);
               order.setAddressId(i);
               order.setStatus("INSERT_TEST");
               orderMapper.insert(order);
               OrderItem item = new OrderItem();
   
               item.setOrderItemId(i);
   
               item.setOrderId(order.getOrderId());
               item.setUserId(i);
               item.setStatus("INSERT_TEST");
               orderItemMapper.insert(item);
               result.add(order.getOrderId());
           }
   ```
   When I run this code, the result is:
   t_order_0
   
![image](https://user-images.githubusercontent.com/2219776/123902338-4d02f900-d99f-11eb-84c0-ec7f536eb4ba.png)
   
   t_order_1
   
![image](https://user-images.githubusercontent.com/2219776/123902417-6d32b800-d99f-11eb-9c57-208697760af6.png)
   
   t_order_item_0
   
![image](https://user-images.githubusercontent.com/2219776/123902468-7facf180-d99f-11eb-884f-18ab131e7a35.png)
   
   t_order_item_1
   
![image](https://user-images.githubusercontent.com/2219776/123902507-8cc9e080-d99f-11eb-80ad-2c0f19a3ec81.png)
   
   The size of table `t_order` is not correct and `order_item_id` of table 
`t_order_item` is not correct.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to