发布于 

MySQL锁

间隙锁

解决RR隔离模式下的幻读问题。

共享锁和排它锁

共享锁:select * from table where id = 1 lock in share mode;

独占锁:select * from table where id = 1 for update;