Error Code: 1213. Deadlock found when trying to get lock; try restarting transaction
做测试,在一个连接里面执行begin;select max(f1) from xxx for update;
在另一个连接里面同样执行begin;select max(f1) from xxx for update;
后,
在前面那个连接的窗口里面执行insert into xxx(f1) values (xxxxxxxxxx)操作;
但是,
另一个连接的窗口就打出了死锁信息.
想知道为什么
推荐个牛人的博客:http://hedengcheng.com/?p=771...
官网:https://dev.mysql.com/doc/ref...