Bug #119482 OPTIMIZE_LOCAL_TABLE does not support databse-level and table-level granting, which is inconsistent to the documentation
Submitted: 1 Dec 12:00 Modified: 1 Dec 12:04
Reporter: Jingzhou Fu Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S3 (Non-critical)
Version:9.5.0 OS:Linux
Assigned to: CPU Architecture:Any

[1 Dec 12:00] Jingzhou Fu
Description:
Currently, OPTIMIZE_LOCAL_TABLE does not support databse-level and table-level granting.

However, the documentation says: "OPTIMIZE_LOCAL_TABLE: 	Enable use of OPTIMIZE LOCAL TABLE or OPTIMIZE NO_WRITE_TO_BINLOG TABLE. Levels: Global, database, table." (https://dev.mysql.com/doc/refman/9.5/en/grant.html)

How to repeat:
CREATE USER foo;
GRANT OPTIMIZE_LOCAL_TABLE ON mysql.* TO foo;
[1 Dec 12:03] Jingzhou Fu
The documentation points out that the OPTIMIZE_LOCAL_TABLE privilege should support these levels: "Levels: Global, database, table", but actually it supports only the global-level.
[1 Dec 12:04] Jingzhou Fu
The above SQL command outputs: "ERROR 3619 (HY000): Illegal privilege level specified for OPTIMIZE_LOCAL_TABLE"