diff options
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 75959540c56..848b37fec62 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2634,7 +2634,6 @@ end: my_error(ER_INVALID_ROLE, MYF(0), rolename); break; case 1: - StringBuffer<1024> c_usr; LEX_CSTRING role_lex; /* First, check if current user can see mysql database. */ bool read_access= !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 1); @@ -2655,11 +2654,9 @@ end: NULL) == -1)) { /* Role is not granted but current user can see the role */ - c_usr.append(user, strlen(user)); - c_usr.append('@'); - c_usr.append(host, strlen(host)); - my_printf_error(ER_INVALID_ROLE, "User %`s has not been granted role %`s", - MYF(0), c_usr.c_ptr(), rolename); + my_printf_error(ER_INVALID_ROLE, "User %`s@%`s has not been granted role %`s", + MYF(0), thd->security_ctx->priv_user, + thd->security_ctx->priv_host, rolename); } else { |