Bug #1090 optional parameter for LOCK TABLES command
Submitted: 19 Aug 2003 3:36 Modified: 21 Aug 2003 2:18
Reporter: Thomas Böhme Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version: OS:
Assigned to: CPU Architecture:Any

[19 Aug 2003 3:36] Thomas Böhme
Description:
I think it would be good if you could use the 'LOCK TABLES' command with no 
automatic UNLOCK TABLES is done before. i.e.

    LOCK TABLES table1 WRITE;
    LOCK TABLES table2 READ NO_UNLOCK;

Now both tables are locked. Omitting the keyword 'NO_UNLOCK' would cause an 
'UNLOCK TABLES' as it is done now.

    UNLOCK TABLES;

Now all tables are unlocked.

How to repeat:
nothing
[21 Aug 2003 2:18] Peter Zaitsev
We have similar feature in ToDo list, it would be implemented however a bit different way:

UNLOCK TABLES <table>,<table>...

That would allow you to free tables as soon as you no more need it (useful for example in mysqldump to unlock table after it is backed up.

Will this suite you ?
[22 Aug 2003 0:50] Thomas Böhme
To unlock only some tables is a good feature, but if you want to include one other table into the 
lock you have to specify the currently lockled tables again in your statement. 
 
So if it is not so much trouble, modification of the LOCK TABLES and UNLOCK TABLES 
syntax would be good.