间隙锁说明 innodb引擎自动使用间隙锁来避免幻读(原因是因为innodb采用单行锁+间隙锁组合而成的行锁,会锁定一个范围和记录本身的行),参数默认innodb_locaks_unsafe_for_binlog为false时开启,True时禁用. 间隙锁的缺点 当高并发访问时执行delete操作和insert操作时,如 delete from user u where u.id = 2; insert into user u values(2); delete from user u wher