summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-07-30 10:07:41 +0200
committerSergei Golubchik <serg@mariadb.org>2020-07-30 23:50:56 +0200
commit09ec8e2e2246f9fb67fd41631c5669d9ae26b2e5 (patch)
tree7fad06fd6e1bfa1921d3ba305dedb63a6acf7bfe /sql/sql_acl.cc
parent4635218cb07ee15244c7a6bbcf6eeeeb7cec7fcf (diff)
downloadmariadb-git-09ec8e2e2246f9fb67fd41631c5669d9ae26b2e5.tar.gz
improve the error message for a dropped current role
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index fee337925fc..cf0b1d87bd7 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -3475,13 +3475,15 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER &combo,
table->key_info->key_length);
if (table->file->ha_index_read_idx_map(table->record[0], 0, user_key,
- HA_WHOLE_KEY,
- HA_READ_KEY_EXACT))
+ HA_WHOLE_KEY, HA_READ_KEY_EXACT))
{
/* what == 'N' means revoke */
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;
}
/*