Bug #90134 | Inconsistent behavior on granting privilege on wildcard database | ||
---|---|---|---|
Submitted: | 20 Mar 2018 2:26 | Modified: | 29 Jun 2018 18:57 |
Reporter: | Jaime Sicam | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Security: Privileges | Severity: | S3 (Non-critical) |
Version: | 5.7.21 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[20 Mar 2018 2:26]
Jaime Sicam
[20 Mar 2018 16:15]
MySQL Verification Team
Hi, This behaviour is as expected, but our documentation requires additional explanations and elucidations. Verified as the documentation bug.
[23 Mar 2018 12:58]
MySQL Verification Team
Hi, This turned out to be a real bug, a bug in the code, and not a documentation bug.
[29 Jun 2018 18:57]
Paul DuBois
Actual behavior is as documented, but the description in the bug report omitted part of the documentation: Based on tests, GRANT using _ without escaping it on database and specifying a particular object on the table works as if _ was escaped. But https://dev.mysql.com/doc/refman/5.7/en/grant.html states that "to use a _ character as part of a database name, specify it as \_ in the GRANT statement, to prevent the user from being able to access additional databases matching the wildcard pattern" The documentation states: The _ and % wildcards are permitted when specifying database names in GRANT statements that grant privileges at the database level. This means, for example, that to use a _ character as part of a database name, specify it as \_ in the GRANT statement, to prevent the user from being able to access additional databases matching the wildcard pattern Note that first sentence, which states that wildcards are permitted only at the database level (ON db_name.*). If the database name is used as a qualifier for other objects such as tables or routines, wildcard characters are treated as normal characters.