Bug #56571 DROP VIEW is not permitted if the view is locked by LOCK TABLE ... WRITE
Submitted: 5 Sep 2010 17:22 Modified: 16 Oct 2012 5:25
Reporter: Elena Stepanova Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Locking Severity:S3 (Non-critical)
Version:5.5.3-m3, 5.5.6-rc, 5.6.0-m4 OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[5 Sep 2010 17:22] Elena Stepanova
Description:
If a view is locked by LOCK TABLE <view> WRITE, further DROP VIEW <view> fails with ER_LOCK_OR_ACTIVE_TRANSACTION (Can't execute the given command because you have active locked tables or an active transaction).

In 5.1 and 5.5 before 5.5.3 the view is successfully dropped.

It might be expected behavior which came with new locking, but I have not found anything about it in the manual.

How to repeat:
CREATE VIEW v AS SELECT 1;
LOCK TABLE v WRITE;
DROP VIEW v;
[13 Sep 2010 9:40] Konstantin Osipov
This is a limitation introduced with the patch for WL#3726, R3/E3 to lift it (totally possible to do, just requires some more coding).
An alternative is to document it.
[16 Oct 2012 5:25] Erlend Dahl
This change is intended and documented.