MDEV-5668 Assertion `granted_role->is_role()' fails on granting role with empty name
parser: error out on empty role names
This commit is contained in:
parent
8dce8ecfda
commit
04de6ccc31
@ -1,3 +1,5 @@
|
||||
grant '' to foo@localhost;
|
||||
ERROR OP000: Invalid role specification ``.
|
||||
create user ''@localhost;
|
||||
create role r1;
|
||||
grant r1 to ''@localhost;
|
@ -1,3 +1,9 @@
|
||||
#
|
||||
# MDEV-5668 Assertion `granted_role->is_role()' fails on granting role with empty name
|
||||
#
|
||||
--error ER_INVALID_ROLE
|
||||
grant '' to foo@localhost;
|
||||
|
||||
#
|
||||
# MDEV-5238 Server crashes in find_role_grant_pair on SHOW GRANTS for an anonymous user
|
||||
#
|
@ -15192,6 +15192,11 @@ current_role:
|
||||
grant_role:
|
||||
ident_or_text
|
||||
{
|
||||
if ($1.length == 0)
|
||||
{
|
||||
my_error(ER_INVALID_ROLE, MYF(0), "");
|
||||
MYSQL_YYABORT;
|
||||
}
|
||||
if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
|
||||
MYSQL_YYABORT;
|
||||
$$->user = $1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user