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

Merge branch '10.5' into mariadb-10.5.23

This commit is contained in:
Oleksandr Byelkin
2023-11-14 08:41:23 +01:00
26 changed files with 355 additions and 26 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
{