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

Merge 10.10 into 10.11

This commit is contained in:
Marko Mäkelä
2023-01-11 11:13:56 +02:00
207 changed files with 3276 additions and 2334 deletions

View File

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
Copyright (c) 2009, 2022, MariaDB
Copyright (c) 2009, 2023, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -396,9 +396,9 @@ public:
update_hostname(&host, safe_strdup_root(mem, host_arg));
}
bool check_validity(bool check_no_resolve)
bool check_validity()
{
if (check_no_resolve &&
if (opt_skip_name_resolve &&
(hostname_requires_resolving(host.hostname) ||
hostname_requires_resolving(proxied_host.hostname)))
{
@ -2571,7 +2571,6 @@ static void push_new_user(const ACL_USER &user)
static bool acl_load(THD *thd, const Grant_tables& tables)
{
READ_RECORD read_record_info;
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
char tmp_name[SAFE_NAME_LEN+1];
Sql_mode_save old_mode_save(thd);
DBUG_ENTER("acl_load");
@ -2614,7 +2613,8 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
host.access= host_table.get_access();
host.access= fix_rights_for_db(host.access);
host.sort= get_magic_sort("hd", host.host.hostname, host.db);
if (check_no_resolve && hostname_requires_resolving(host.host.hostname))
if (opt_skip_name_resolve &&
hostname_requires_resolving(host.host.hostname))
{
sql_print_warning("'host' entry '%s|%s' "
"ignored in --skip-name-resolve mode.",
@ -2689,7 +2689,8 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
}
else
{
if (check_no_resolve && hostname_requires_resolving(user.host.hostname))
if (opt_skip_name_resolve &&
hostname_requires_resolving(user.host.hostname))
{
sql_print_warning("'user' entry '%s@%s' "
"ignored in --skip-name-resolve mode.", user.user.str,
@ -2747,7 +2748,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
sql_print_warning("Found an entry in the 'db' table with empty database name; Skipped");
continue;
}
if (check_no_resolve && hostname_requires_resolving(db.host.hostname))
if (opt_skip_name_resolve && hostname_requires_resolving(db.host.hostname))
{
sql_print_warning("'db' entry '%s %s@%s' "
"ignored in --skip-name-resolve mode.",
@ -2802,7 +2803,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
{
ACL_PROXY_USER proxy;
proxy.init(proxies_priv_table, &acl_memroot);
if (proxy.check_validity(check_no_resolve))
if (proxy.check_validity())
continue;
if (push_dynamic(&acl_proxy_users, (uchar*) &proxy))
DBUG_RETURN(TRUE);
@ -8028,7 +8029,6 @@ static bool grant_load(THD *thd,
{
bool return_val= 1;
TABLE *t_table, *c_table, *p_table;
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
MEM_ROOT *save_mem_root= thd->mem_root;
DBUG_ENTER("grant_load");
@ -8075,7 +8075,7 @@ static bool grant_load(THD *thd,
goto end_unlock;
}
if (check_no_resolve)
if (opt_skip_name_resolve)
{
if (hostname_requires_resolving(mem_check->host.hostname))
{
@ -8119,7 +8119,7 @@ static bool grant_load(THD *thd,
goto end_unlock_p;
}
if (check_no_resolve)
if (opt_skip_name_resolve)
{
if (hostname_requires_resolving(mem_check->host.hostname))
{
@ -12215,8 +12215,7 @@ void Sql_cmd_grant::warn_hostname_requires_resolving(THD *thd,
List_iterator <LEX_USER> it(users);
while ((user= it++))
{
if (specialflag & SPECIAL_NO_RESOLVE &&
hostname_requires_resolving(user->host.str))
if (opt_skip_name_resolve && hostname_requires_resolving(user->host.str))
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WARN_HOSTNAME_WONT_WORK,
ER_THD(thd, ER_WARN_HOSTNAME_WONT_WORK));