shihuizhen opened a new issue #7922:
URL: https://github.com/apache/shardingsphere/issues/7922


   example:
   
   table:
    CREATE TABLE `t_order_item` (
     `item_id` bigint(20) NOT NULL,
     `order_id` bigint(20) unsigned DEFAULT NULL,
     `user_id` int(11) NOT NULL,
     `status` varchar(45) DEFAULT NULL,
     `creation_date` date DEFAULT NULL,
     PRIMARY KEY (`item_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
   
   config_sharding:
   shardingRule:
    tables:
      t_order:
        actualDataNodes: ds_${0..5}.t_order_${0..1}
        tableStrategy:
          inline:
            shardingColumn: order_id
            algorithmExpression: t_order_${order_id % 2}
       #  keyGenerator:
       #    type: SNOWFLAKE
       #    column: order_id
      t_order_item:
        actualDataNodes: ds_${0..5}.t_order_item_${0..1}
        tableStrategy:
          inline:
            shardingColumn: order_id
            algorithmExpression: t_order_item_${order_id % 2}
        keyGenerator:
          type: SNOWFLAKE
          column: item_id
   
   case1:
   INSERT INTO t_order_item(order_id,user_id,status,creation_date) VALUES 
(2111,21,' init',' 2017-08-31');
   select @@IDENTITY as insert_id from t_order_item;
   
   result is not correct!
   
   case2:
   INSERT INTO t_order_item(order_id,user_id,status,creation_date) VALUES 
(2111,21,' init',' 2017-08-31');
   SELECT LAST_INSERT_ID();
   
   result 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.

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


Reply via email to