There is a problem of read repetition in LOCK TABLES auto_table WRITE;.

The basic logic of the

program is as follows:
execute "LOCK TABLES auto_table WRITE";
then "select ID from auto_table;
then update ID+1" UPDATE auto_table set ID=ID+1 ";
finally execute" UNLOCK TABLES "

but this logic occurs when two users read the same ID. Is it related to concurrency? Or is it something else?

Feb.28,2021
Menu