一个奇怪的加锁案例–Execute “ if(not exists (select ..))” locked next record
https://bugs.mysql.com/bug.php?id=85431
- 表结构:
create table t(id1 int,id2 int,id3 int, unique key(id2,id3)); - 数据:
insert into t values(1,1,1);
insert into t values(20,20,20); - 存储过程:
create a procedure:
delimiter //
create procedure p()
begin
if(not exists (<