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

Merge remote-tracking branch '10.4' into 10.5

This commit is contained in:
Oleksandr Byelkin
2023-03-31 21:32:41 +02:00
306 changed files with 10920 additions and 6615 deletions

View File

@ -4635,7 +4635,10 @@ mysql_execute_command(THD *thd)
thd->protocol= save_protocol;
}
if (!res && thd->lex->analyze_stmt)
res= thd->lex->explain->send_explain(thd);
{
bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
res= thd->lex->explain->send_explain(thd, extended);
}
delete sel_result;
MYSQL_INSERT_DONE(res, (ulong) thd->get_row_count_func());
/*
@ -4815,7 +4818,10 @@ mysql_execute_command(THD *thd)
thd->protocol= save_protocol;
}
if (!res && (explain || lex->analyze_stmt))
res= thd->lex->explain->send_explain(thd);
{
bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
res= thd->lex->explain->send_explain(thd, extended);
}
/* revert changes for SP */
MYSQL_INSERT_SELECT_DONE(res, (ulong) thd->get_row_count_func());
@ -4882,7 +4888,10 @@ mysql_execute_command(THD *thd)
if (thd->lex->analyze_stmt || thd->lex->describe)
{
if (!res)
res= thd->lex->explain->send_explain(thd);
{
bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
res= thd->lex->explain->send_explain(thd, extended);
}
}
delete sel_result;
@ -4943,7 +4952,10 @@ mysql_execute_command(THD *thd)
else
{
if (lex->describe || lex->analyze_stmt)
res= thd->lex->explain->send_explain(thd);
{
bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
res= thd->lex->explain->send_explain(thd, extended);
}
}
multi_delete_error:
delete result;
@ -6328,7 +6340,10 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
thd->protocol= save_protocol;
}
if (!res)
res= thd->lex->explain->send_explain(thd);
{
bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
res= thd->lex->explain->send_explain(thd, extended);
}
}
}
}
@ -9363,7 +9378,9 @@ static my_bool kill_threads_callback(THD *thd, kill_threads_callback_arg *arg)
if (!(arg->thd->security_ctx->master_access &
PRIV_KILL_OTHER_USER_PROCESS) &&
!arg->thd->security_ctx->user_matches(thd->security_ctx))
return 1;
{
return MY_TEST(arg->thd->security_ctx->master_access & PROCESS_ACL);
}
if (!arg->threads_to_kill.push_back(thd, arg->thd->mem_root))
{
mysql_mutex_lock(&thd->LOCK_thd_kill); // Lock from delete
@ -9485,7 +9502,10 @@ sql_kill_user(THD *thd, LEX_USER *user, killed_state state)
my_ok(thd, rows);
break;
case ER_KILL_DENIED_ERROR:
my_error(error, MYF(0), (long long) thd->thread_id);
char buf[DEFINER_LENGTH+1];
strxnmov(buf, sizeof(buf), user->user.str, "@", user->host.str, NULL);
my_printf_error(ER_KILL_DENIED_ERROR, ER_THD(thd, ER_CANNOT_USER), MYF(0),
"KILL USER", buf);
break;
case ER_OUT_OF_RESOURCES:
default: