[2019-08-04 14:33:48] Connected sql> start transaction [2019-08-04 14:33:49] completed in 4 ms sql> begin [2019-08-04 14:33:49] completed in 6 ms sql> insert into test_lock.test values(‘i’,’daqiao’,’daqiao123456’,0,’15112345678’) [2019-08-04 14:34:00] [40001][1213] Deadlock found when trying to get lock; try restarting transaction [2019-08-04 14:34:00] [40001][1213] Deadlock found when trying to get lock; try restarting transaction
LATEST DETECTED DEADLOCK ------------------------ 2019-08-0406:33:590x7f1818599700 *** (1) TRANSACTION: TRANSACTION 231690, ACTIVE 34 sec inserting mysql tables in use1, locked 1 LOCK WAIT 4 lock struct(s), heap size 1136, 2 row lock(s) MySQL thread id 9, OS thread handle 139741464762112, query id 95172.17.0.1 root update /* ApplicationName=IntelliJ IDEA 2019.1.3 */ insert into test_lock.`test` values('i','daqiao','daqiao123456',0,'15112345678') *** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 7 page no 4 n bits 80 index PRIMARY of table`test_lock`.`test` trx id 231690 lock_mode X insert intention waiting Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0 0: len 8; hex 73757072656d756d; asc supremum;;
*** (2) TRANSACTION: TRANSACTION 231691, ACTIVE 10 sec inserting mysql tables in use1, locked 1 4 lock struct(s), heap size 1136, 2 row lock(s) MySQL thread id 10, OS thread handle 139741464467200, query id 139172.17.0.1 root update /* ApplicationName=IntelliJ IDEA 2019.1.3 */ insert into test_lock.`test` values('i','daqiao','daqiao123456',0,'15112345678') *** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 7 page no 4 n bits 80 index PRIMARY of table`test_lock`.`test` trx id 231691 lock mode S Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0 0: len 8; hex 73757072656d756d; asc supremum;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 7 page no 4 n bits 80 index PRIMARY of table`test_lock`.`test` trx id 231691 lock_mode X insert intention waiting Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0 0: len 8; hex 73757072656d756d; asc supremum;;