Bug #60677 "User Has Rights To Database That Does Not Exist" gives false positives
Submitted: 28 Mar 2011 15:43 Modified: 23 Sep 2011 22:36
Reporter: Daniël van Eeden Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Advisors/Rules Severity:S3 (Non-critical)
Version:2.3.1 OS:Any
Assigned to: CPU Architecture:Any

[28 Mar 2011 15:43] Daniël van Eeden
Description:
The "User Has Rights To Database That Does Not Exist" (v1.2) rule gives false positives as a wildcard is used in the database name for a GRANT statement.

How to repeat:
CREATE DATABASE test_t01;
CREATE DATABASE test_t02;
CREATE DATABASE test_t03;
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'test';
GRANT SELECT ON `test_%`.* TO 'test'@'localhost';

Suggested fix:
Update this rule.
[13 Apr 2011 11:06] Valeriy Kravchuk
Thank you for the bug report. Verified just as described.
[23 Sep 2011 22:36] John Russell
Added to 2.3.6 changelog:

If a GRANT statement used a SQL-style wildcard (% or _) in the
database name, the rule User Has Rights To Database That Does Not
Exist could produce an incorrect alert. For example, this statement
could cause a false positive when evaluating the rule expression:
GRANT SELECT ON `test_%`.* TO testuser@localhost;