-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-9580 SHOW GRANTS FOR <current_user> fails
use get_current_user() to distinguish user name without a hostname and a role name. move privilege checks inside mysql_show_grants() to remove duplicate get_current_user() calls
- Loading branch information
Showing
4 changed files
with
48 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
SHOW GRANTS FOR root@invalid_host; | ||
ERROR 42000: There is no such grant defined for user 'root' on host 'invalid_host' | ||
create user test; | ||
create user foo; | ||
create role foo; | ||
grant foo to test; | ||
set role foo; | ||
show grants for test; | ||
Grants for test@% | ||
GRANT foo TO 'test'@'%' | ||
GRANT USAGE ON *.* TO 'test'@'%' | ||
show grants for foo; | ||
Grants for foo | ||
GRANT USAGE ON *.* TO 'foo' | ||
show grants for foo@'%'; | ||
ERROR 42000: Access denied for user 'test'@'%' to database 'mysql' | ||
drop user test, foo; | ||
drop role foo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters