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

Merge 10.6 into 10.9

This commit is contained in:
Marko Mäkelä
2023-07-10 11:22:21 +03:00
39 changed files with 698 additions and 65 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,7 +121,9 @@ 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);
select_lex->set_explain_type(TRUE);
@ -474,7 +477,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 +605,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 +993,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: