Question: 5
How does the InnoDB storage engine handle deadlocks when they are detected?
A. Both the affected transactions will be rolled back.
B. The affected transactions wait for innodb_lock_wait_timeout seconds, and then roll back.
C. One of the affected transactions will be rolled back, the other is allowed to proceed.
D. The transaction isolation level determines which transaction is rolled back.
E. The innodb_locks_unsafe_for_binlog setting determines which transaction is rolled back.
解析:InnoDB检测到死锁发生时,会根据事务大小(事务涉及增删改到行数)回滚最小的事务,其它事务正常运行。答案:C