tristaZero commented on issue #6918: URL: https://github.com/apache/shardingsphere/issues/6918#issuecomment-676994977
Hi@291277058 Thanks for your clarification. Now, much clear. However, that will get the wrong route result, IMO. Suppose the sharding algorithm is mod(2) for `sharding key`, then `A` DB is for records with even sharding key, and `B` DB is for those with odd sharding key. Let's take `set shardingKey= 1 where id = 0` for example. There may be a record whose id =0 and shardingKey = 0 (See, target stored in `A` DB). If we use`shardingKey= 1` for routing, this SQL will be routed to `B` DB. As a result, no record is updated. What's more,`ShardingUpdateStatementValidator` tells us that updating `sharding-key` is not permitted. I am not sure my explanation is what you expected. If not, please comment here. ---------------------------------------------------------------- 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]
