What happens when InnoDB detects a deadlock?
- A Both transactions hang until timeout
- B It rolls back the transaction that has done less work
- C It restarts the MySQL server
- D It commits both transactions
Answer
It rolls back the transaction that has done less work
InnoDB detects the lock cycle and rolls back the cheaper victim with error 1213. Applications must be written to retry the failed transaction.





