Deadlock found when trying to get lock; try restarting transaction
进程1
update test_table set key1=1 where id=1
sleep 10s
update test_table set key1=2 where id=2
进程2
update test_table set key2=1 where id=2
sleep 10s
update test_table set key2=2 where id=1
假如进程1先执行,1s后执行进程2,结果:
原文:https://www.cnblogs.com/Xjng/p/14958435.html