Bug #54767 Please document the effect of metadata locks taken by failing statements
Submitted: 24 Jun 2010 10:35 Modified: 25 Jun 2010 14:36
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5.4-m3 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: documentation, locking, mdl

[24 Jun 2010 10:35] Matthias Leich
Description:
If we are within a transaction and run some
syntactical correct statement than metadata
locks on involved objects like tables are taken.
These locks will be not removed even if the
execution of the statement itself fails because
of a lock timeout.
This means statements of other transactions
needing a metadata lock on the same object
will have to wait for the removal of this lock
and of course might end with lock timeout.

This behaviour needs to be documented.

How to repeat:
Please have a look at
http://bugs.mysql.com/bug.php?id=52377
[25 Jun 2010 14:36] 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 products.

Added to http://dev.mysql.com/doc/refman/5.5/en/metadata-locking.html:

        If the server acquires metadata locks for a statement that is
        syntactically valid but fails during execution, it does not
        release the locks early. Lock release is still deferred to the
        end of the transaction because the failed statement is written
        to the binary log and the locks protect log consistency.