Bug #45354 LOCK TABLES is not a TABLE privilege
Submitted: 5 Jun 2009 16:38 Modified: 30 Nov 2011 16:04
Reporter: Marc ALFF Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S1 (Critical)
Version:6.0, 4.1, 5.0, 5.1 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[5 Jun 2009 16:38] Marc ALFF
Description:
The LOCK TABLES privilege can be granted:
- globally
- on a database schema

but can not be granted on a table only.

How to repeat:
create table test.t1(a int);

This statement fails, and is expected to work:

grant lock tables on test.t1 to 'user'@localhost with grant option;

Suggested fix:
Add LOCK_TABLES_ACL to TABLES_ACLS
[5 Jun 2009 19:59] MySQL Verification Team
Thank you for the bug report.
[3 Aug 2009 17:44] Konstantin Osipov
Stefan, I don't see any bug in the implementation here.
Perhaps the docs need to be updated.
[30 Nov 2011 10:45] Leandro Morgado
Can someone update the docs please? This doesn't work for a single table:

mysql> GRANT LOCK TABLES ON mysql.* TO 'user4'@'localhost' identified by 'user4@123';Query OK, 0 rows affected (0.05 sec)

mysql> DROP USER 'user4'@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT LOCK TABLES ON mysql.user TO 'user4'@'localhost' identified by 'user4@123';ERROR 1144 (42000): Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used
[30 Nov 2011 16:04] 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.