Commit 09ec8e2e authored by Sergei Golubchik's avatar Sergei Golubchik

improve the error message for a dropped current role

parent 4635218c
...@@ -2,4 +2,4 @@ create role r; ...@@ -2,4 +2,4 @@ create role r;
set role r; set role r;
drop role r; drop role r;
revoke all on *.* from current_role; revoke all on *.* from current_role;
ERROR 42000: There is no such grant defined for user 'r' on host '' ERROR OP000: Invalid role specification `r`.
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
create role r; create role r;
set role r; set role r;
drop role r; drop role r;
error ER_NONEXISTING_GRANT; error ER_INVALID_ROLE;
revoke all on *.* from current_role; revoke all on *.* from current_role;
...@@ -3475,13 +3475,15 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER &combo, ...@@ -3475,13 +3475,15 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER &combo,
table->key_info->key_length); table->key_info->key_length);
if (table->file->ha_index_read_idx_map(table->record[0], 0, user_key, if (table->file->ha_index_read_idx_map(table->record[0], 0, user_key,
HA_WHOLE_KEY, HA_WHOLE_KEY, HA_READ_KEY_EXACT))
HA_READ_KEY_EXACT))
{ {
/* what == 'N' means revoke */ /* what == 'N' means revoke */
if (what == 'N') if (what == 'N')
{ {
my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str); if (combo.host.length)
my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str);
else
my_error(ER_INVALID_ROLE, MYF(0), combo.user.str);
goto end; goto end;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment