start transaction;
select * from test where id = 8 for share;
update test set name = "grayvtouch" where id = 8;
select * from test where id = 8 for share;
at first I thought it was a shared lock , but as a result, I did get stuck by executing the following statement in another session:
select * from test where id = 8 for share;
this means that after the above transaction is executed (uncommitted), the lock finally added to the id = 8
record is the exclusive lock .
excuse me, is this the actual situation? Why is there such a phenomenon?