I received the following deadlock log via \"SHOW INNODB STATUS\". Can someone care to explain why the transaction was aborted? It seems that Transaction 2 is holding the loc
I'm not 100% sure but I believe they are not "the same lock".
* (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 0 page no 17549 n bits 128 index
PRIMARYof tabletakeyourorder/jobstrx id 0 479286429 lock_mode X waiting Record lock, heap no 61 PHYSICAL RECORD: n_fields 26; compact format; info bits 0* (2) HOLDS THE LOCK(S): RECORD LOCKS space id 0 page no 17549 n bits 128 index
PRIMARYof tabletakeyourorder/jobstrx id 0 479286425 lock_mode X locks rec but not gap Record lock, heap no 61 PHYSICAL RECORD: n_fields 26; compact format; info bits 0* (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 0 page no 17548 n bits 144 index
PRIMARYof tabletakeyourorder/jobstrx id 0 479286425 lock_mode X locks rec but not gap waiting Record lock, heap no 73 PHYSICAL RECORD: n_fields 26; compact format; info bits 0
Tx(2) holds "heap no 61" record lock and is waiting for "heap no 73" record lock. Tx(1) is waiting for "heap no 61". The log doesn't tell who holds "heap no 73" but maybe it's just a limitation of "SHOW ENGINE INNODB STATUS". You can confirm that similar log will be generated by simple deadlock scenario.