mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #36011: server crash with explain extended on query
with dependent subqueries An IN subquery is executed on EXPLAIN when it's not correlated. If the subquery required a temporary table for its execution not all the internal structures were restored from pointing to the items of the temporary table to point back to the items of the subquery. Fixed by restoring the ref array when a temp tables were used in executing the IN subquery during EXPLAIN EXTENDED.
This commit is contained in:
@ -2104,11 +2104,12 @@ JOIN::exec()
|
||||
/*
|
||||
With EXPLAIN EXTENDED we have to restore original ref_array
|
||||
for a derived table which is always materialized.
|
||||
Otherwise we would not be able to print the query correctly.
|
||||
We also need to do this when we have temp table(s).
|
||||
Otherwise we would not be able to print the query correctly.
|
||||
*/
|
||||
if (items0 &&
|
||||
(thd->lex->describe & DESCRIBE_EXTENDED) &&
|
||||
select_lex->linkage == DERIVED_TABLE_TYPE)
|
||||
if (items0 && (thd->lex->describe & DESCRIBE_EXTENDED) &&
|
||||
(select_lex->linkage == DERIVED_TABLE_TYPE ||
|
||||
exec_tmp_table1 || exec_tmp_table2))
|
||||
set_items_ref_array(items0);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
|
Reference in New Issue
Block a user