roodkcab edited a comment on issue #14144:
URL: 
https://github.com/apache/shardingsphere/issues/14144#issuecomment-997139249


   `update id_gen set max_id = last_insert_id(max_id + 1) where type = 1` and 
then use `select last_insert_id()` is recommended in MySQL 
[manual](https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_last-insert-id)
   
   
![image](https://user-images.githubusercontent.com/1700820/146628056-a3b2430f-97dd-4824-ad0f-1830145f95f0.png)
   
   for shardingsphere, there's a problem that we use a connection pool, `select 
last_insert_id` may sent to a connection other than the one used for `update` 
without transaction, which leading to wrong last_insert_id.


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