1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.3' into 10.4

This commit is contained in:
Oleksandr Byelkin
2021-07-31 22:59:58 +02:00
339 changed files with 7425 additions and 2358 deletions

View File

@ -3121,7 +3121,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);
@ -3142,11 +3141,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
{
@ -9261,14 +9258,13 @@ static bool show_default_role(THD *thd, ACL_USER *acl_entry,
String def_str(buff, buffsize, system_charset_info);
def_str.length(0);
def_str.append(STRING_WITH_LEN("SET DEFAULT ROLE "));
def_str.append(&def_rolename);
def_str.append(" FOR '");
def_str.append(&acl_entry->user);
append_identifier(thd, &def_str, def_rolename.str, def_rolename.length);
def_str.append(" FOR ");
append_identifier(thd, &def_str, acl_entry->user.str, acl_entry->user.length);
DBUG_ASSERT(!(acl_entry->flags & IS_ROLE));
def_str.append(STRING_WITH_LEN("'@'"));
def_str.append(acl_entry->host.hostname, acl_entry->hostname_length,
system_charset_info);
def_str.append('\'');
def_str.append('@');
append_identifier(thd, &def_str, acl_entry->host.hostname,
acl_entry->hostname_length);
protocol->prepare_for_resend();
protocol->store(def_str.ptr(),def_str.length(),def_str.charset());
if (protocol->write())