1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.5 into 10.6

This commit is contained in:
Marko Mäkelä
2023-11-15 14:10:21 +02:00
27 changed files with 357 additions and 27 deletions

View File

@ -3339,10 +3339,18 @@ end:
check_role_is_granted_callback,
NULL) == -1))
{
/* Role is not granted but current user can see the role */
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);
/* This happens for SET ROLE case and when `--skip-name-resolve` option
is used. In that situation host can be NULL and current user is always
target user, so printing `priv_user@priv_host` is not incorrect.
*/
if (!host)
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
/* Role is not granted but current user can see the role */
my_printf_error(ER_INVALID_ROLE, "User %`s@%`s has not been granted role %`s",
MYF(0), user, host, rolename);
}
else
{