标签:
drop table if exists a ; create table a ( a int primary key, b varchar(30) ) engine = innodb; insert into values (1,‘a‘),(2,‘b‘),(3,‘c‘),(4,‘d‘);
A: begin; select * from a where a= 4 for update; B: begin; select * from a where a <=2 lock in share mode; delete from a where a = 3; select * from a where a <=2 lock in share mode;
标签:
原文地址:http://www.cnblogs.com/jiangwenju/p/5811281.html