示例
行锁-InnoDB
create table rlock(a int(10) unsigned not null auto_increment primary key)engine=InnoDB;
insert into rlock(a) values(1),(2),(3);
insert into rlock select null from rlock;
session1:
关于innodb 行锁超时时间的设置https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_lock_wait_timeout
session2:
session3:
注意:Id-10的查询状态为updating而不是locked
验证InnoDB引擎中是否有一个请求阻塞
show engine innodb status\G