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

Merge 10.9 into 10.10

This commit is contained in:
Marko Mäkelä
2023-07-26 14:17:36 +03:00
148 changed files with 4410 additions and 2158 deletions

View File

@ -56,7 +56,7 @@
invoked on a running DELETE statement.
*/
Explain_delete* Delete_plan::save_explain_delete_data(MEM_ROOT *mem_root, THD *thd)
Explain_delete* Delete_plan::save_explain_delete_data(THD *thd, MEM_ROOT *mem_root)
{
Explain_query *query= thd->lex->explain;
Explain_delete *explain=
@ -73,7 +73,7 @@ Explain_delete* Delete_plan::save_explain_delete_data(MEM_ROOT *mem_root, THD *t
else
{
explain->deleting_all_rows= false;
if (Update_plan::save_explain_data_intern(mem_root, explain,
if (Update_plan::save_explain_data_intern(thd, mem_root, explain,
thd->lex->analyze_stmt))
return 0;
}
@ -84,21 +84,22 @@ Explain_delete* Delete_plan::save_explain_delete_data(MEM_ROOT *mem_root, THD *t
Explain_update*
Update_plan::save_explain_update_data(MEM_ROOT *mem_root, THD *thd)
Update_plan::save_explain_update_data(THD *thd, MEM_ROOT *mem_root)
{
Explain_query *query= thd->lex->explain;
Explain_update* explain=
new (mem_root) Explain_update(mem_root, thd->lex->analyze_stmt);
if (!explain)
return 0;
if (save_explain_data_intern(mem_root, explain, thd->lex->analyze_stmt))
if (save_explain_data_intern(thd, mem_root, explain, thd->lex->analyze_stmt))
return 0;
query->add_upd_del_plan(explain);
return explain;
}
bool Update_plan::save_explain_data_intern(MEM_ROOT *mem_root,
bool Update_plan::save_explain_data_intern(THD *thd,
MEM_ROOT *mem_root,
Explain_update *explain,
bool is_analyze)
{
@ -120,9 +121,13 @@ bool Update_plan::save_explain_data_intern(MEM_ROOT *mem_root,
return 0;
}
if (is_analyze)
if (is_analyze ||
(thd->variables.log_slow_verbosity &
LOG_SLOW_VERBOSITY_ENGINE))
table->file->set_time_tracker(&explain->table_tracker);
explain->handler_for_stats= table->file;
select_lex->set_explain_type(TRUE);
explain->select_type= select_lex->type;
/* Partitions */
@ -474,7 +479,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
query_type= THD::STMT_QUERY_TYPE;
error= -1;
deleted= maybe_deleted;
if (!query_plan.save_explain_delete_data(thd->mem_root, thd))
if (!query_plan.save_explain_delete_data(thd, thd->mem_root))
error= 1;
goto cleanup;
}
@ -602,7 +607,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
if (thd->lex->describe)
goto produce_explain_and_leave;
if (!(explain= query_plan.save_explain_delete_data(thd->mem_root, thd)))
if (!(explain= query_plan.save_explain_delete_data(thd, thd->mem_root)))
goto got_error;
ANALYZE_START_TRACKING(thd, &explain->command_tracker);
@ -990,7 +995,7 @@ produce_explain_and_leave:
We come here for various "degenerate" query plans: impossible WHERE,
no-partitions-used, impossible-range, etc.
*/
if (!(query_plan.save_explain_delete_data(thd->mem_root, thd)))
if (!(query_plan.save_explain_delete_data(thd, thd->mem_root)))
goto got_error;
send_nothing_and_leave: