1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-33165 Incorrect result interceptor passed to mysql_explain_union()

Statements affect by this bug are all SQL statements that
1) prefixed with "EXPLAIN"
2) have a lower level join structure created for a union subquery.

A bug in select_describe() passed an incorrect "result" object to
mysql_explain_union(), resulting in unpredictable behaviour and
out of context calls.

Reviewed by: Oleksandr Byelkin, sanja@mariadb.com
This commit is contained in:
Rex
2024-01-12 09:32:34 +12:00
committed by Rex Johnston
parent 207c85783b
commit 117388225c
3 changed files with 64 additions and 2 deletions

View File

@ -27953,7 +27953,6 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
bool distinct,const char *message)
{
THD *thd=join->thd;
select_result *result=join->result;
DBUG_ENTER("select_describe");
if (join->select_lex->pushdown_select)
@ -27988,7 +27987,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (unit->explainable())
{
if (mysql_explain_union(thd, unit, result))
if (mysql_explain_union(thd, unit, unit->result))
DBUG_VOID_RETURN;
}
}