taojintianxia opened a new issue #5219: redundant insert (insert twice)
URL: https://github.com/apache/incubator-shardingsphere/issues/5219
 
 
   ## Question
   
   hi , there 
   
   today I got an wired behavier, I insert a data as following sql through 
sharding proxy, however , there are two records insert into database 
   
   ```
   INSERT INTO `t_order`(`id`,`user_id`) VALUES(5,105);
   ```
   
   
![image](https://user-images.githubusercontent.com/4112856/79555077-94220880-80d1-11ea-9520-60d64c547642.png)
   
   followings are my `config-sharding.yaml` :
   
   ```yaml
   shardingRule:
     tables:
       t_order:
         actualDataNodes: ds_${0..1}.t_order_${0..1}
         databaseStrategy:
           inline:
             shardingColumn: user_id
             algorithmExpression: ds_${user_id % 2}
         tableStrategy: 
           inline:
             shardingColumn: order_id
             algorithmExpression: t_order_${order_id % 2}
         keyGenerator:
           type: SNOWFLAKE
           column: id
   ```
   
   and this is the structure of t_order :
   
   ```sql
   CREATE TABLE `t_order` (
     `id` int(11) NOT NULL,
     `user_id` varchar(12) DEFAULT NULL,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=latin1
   ```
   I'm not sure why , I checked manual, but seems the config is not incorrect.
   
   
   

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


With regards,
Apache Git Services

Reply via email to