Merge branch '11.6' into 11.7

This commit is contained in:
Oleksandr Byelkin 2024-11-09 19:01:12 +01:00
commit b12ff287ec
789 changed files with 10342 additions and 4415 deletions

View file

@ -2373,11 +2373,10 @@ static int set_user_auth(THD *thd, const LEX_CSTRING &user,
mysql_mutex_assert_owner(&acl_cache->lock);
// check for SET PASSWORD
if (!plugin)
{
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_PLUGIN_IS_NOT_LOADED,
ER_THD(thd, ER_PLUGIN_IS_NOT_LOADED), plugin_name);
my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), plugin_name);
return ER_PLUGIN_IS_NOT_LOADED;
}
@ -2402,7 +2401,8 @@ static int set_user_auth(THD *thd, const LEX_CSTRING &user,
res= ER_NOT_VALID_PASSWORD;
goto end;
}
if (pwtext.length)
if (!auth->auth_string.length)
{
if (info->hash_password)
{
@ -2417,7 +2417,7 @@ static int set_user_auth(THD *thd, const LEX_CSTRING &user,
auth->auth_string.str= (char*)memdup_root(&acl_memroot, buf, len+1);
auth->auth_string.length= len;
}
else
else if (pwtext.length)
{
res= ER_SET_PASSWORD_AUTH_PLUGIN;
goto end;
@ -2431,6 +2431,21 @@ static int set_user_auth(THD *thd, const LEX_CSTRING &user,
res= 0;
end:
switch(res)
{
case ER_OUTOFMEMORY: // should be reported by my_malloc
case ER_NOT_VALID_PASSWORD: // should be reported by plugin
case ER_PASSWD_LENGTH: // should be reported by plugin
DBUG_ASSERT(thd->is_error());
/* fall through*/
case 0:
break;
case ER_SET_PASSWORD_AUTH_PLUGIN:
my_error(res, MYF(0), plugin_name);
break;
default:
DBUG_ASSERT(0);
}
if (unlock_plugin)
plugin_unlock(thd, plugin);
return res;
@ -2556,7 +2571,6 @@ bool acl_init(bool dont_read_acl_tables)
*/
if (!(thd=new THD(0)))
DBUG_RETURN(1); /* purecov: inspected */
thd->thread_stack= (char*) &thd;
thd->store_globals();
thd->set_query_inner((char*) STRING_WITH_LEN("intern:acl_init"),
default_charset_info);
@ -8131,7 +8145,6 @@ bool grant_init()
if (!(thd= new THD(0)))
DBUG_RETURN(1); /* purecov: deadcode */
thd->thread_stack= (char*) &thd;
thd->store_globals();
thd->set_query_inner((char*) STRING_WITH_LEN("intern:grant_init"),
default_charset_info);