Bug #13182 Deadlock or a lock wait timeout in InnoDB does not cancel the effect of 'BEGIN'
Submitted: 14 Sep 2005 14:26 Modified: 16 Sep 2005 16:22
Reporter: Heikki Tuuri Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:All OS:Any (All)
Assigned to: CPU Architecture:Any

[14 Sep 2005 14:26] Heikki Tuuri
Description:
Dear docs team,

please note in the docs that a deadlock or a lockwait timeout error (prior to 5.0.13)is handled in the following way:

The current transaction is rolled back. Note that if the user has issued BEGIN or START TRANSACTION to start the transaction, this rollback does not cancel the effect of those commands. Further SQL statements are grouped into one transaction until the user issues COMMIT, ROLLBACK, or some SQL command that does an implicit commit.

Regards,

Heikki

How to repeat:
N/A
[15 Sep 2005 18:58] Paul Dubois
Heikki,

What if the transaction was begun by SET AUTOCOMMIT = 0?
Same effect as beginning the transaction with START
TRANSACTION or BEGIN, or is the effect different?
[16 Sep 2005 15:30] Heikki Tuuri
Paul,

if AUTOCOMMIT=0, then there is nothing to document. After the rollback, we group succeeding SQL statements into one transaction until the user issues COMMIT, ROLLBACK, or an SQL statement that does an implicit commit.

---

The rollback in a deadlock is a real rollaback: it ends the current transaction. But it does not cancel the effect of BEGIN because the logic of BEGIN is controlled on a higher level in MySQL. Note that some table handlers might only rollback the current SQL statement in a deadlock.

Regards,

Heikki
[16 Sep 2005 16:22] Paul Dubois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).
[10 Jun 2010 15:24] Vojtech Kurka
I still do not see this fixed: http://dev.mysql.com/doc/refman/5.1/en/innodb-deadlock-detection.html

Please include this in the documentation, it's really not clear for developers.

Thank you