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

Merge branch '10.3' into 10.4

This commit is contained in:
Oleksandr Byelkin
2022-11-02 13:13:45 +01:00
8 changed files with 89 additions and 1 deletions

View File

@ -1204,6 +1204,15 @@ JOIN::prepare(TABLE_LIST *tables_init,
// simple check that we got usable conds
dbug_print_item(conds);
/*
It is hack which force creating EXPLAIN object always on runt-time arena
(because very top JOIN::prepare executes always with runtime arena, but
constant subquery like (SELECT 'x') can be called with statement arena
during prepare phase of top SELECT).
*/
if (!(thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_PREPARE))
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
if (select_lex->handle_derived(thd->lex, DT_PREPARE))
DBUG_RETURN(-1);
@ -1654,7 +1663,6 @@ bool JOIN::build_explain()
int JOIN::optimize()
{
int res= 0;
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
join_optimization_state init_state= optimization_state;
if (select_lex->pushdown_select)
{