Check the transaction isolation level in MySQL client A (the default is RR level),
start the transaction on client A, and check the trax_learn table.
Open a new client B and add a new piece of data to the trax_learn table.
Check the trax_learn table in client A again and find that there are still only two records.
Commit the transaction on client A. commit, and check again.
It is found that the data inserted in client B is displayed, indicating that during the transaction execution of client A, the operation of client B on the table will not affect client A, avoiding phantom reading.
The main reason for this situation is that ordinary select statements are snapshot reads , and when transaction A starts, its snapshot data has been locked by the version. If transaction A is adjusted to the current read , a phantom read will occur.
Therefore, it is not accurate to say that the RR isolation level of InnoDB solves the problem of phantom reading or does not solve it. It should be said that it does not completely solve the problem of phantom reading.