mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge branch '10.6' into 10.7
This commit is contained in:
@ -4965,7 +4965,21 @@ bool st_select_lex::optimize_unflattened_subqueries(bool const_only)
|
||||
}
|
||||
if (empty_union_result)
|
||||
subquery_predicate->no_rows_in_result();
|
||||
if (!is_correlated_unit)
|
||||
|
||||
if (is_correlated_unit)
|
||||
{
|
||||
/*
|
||||
Some parts of UNION are not correlated. This means we will need to
|
||||
re-execute the whole UNION every time. Mark all parts of the UNION
|
||||
as correlated so that they are prepared to be executed multiple
|
||||
times (if we don't do that, some part of the UNION may free its
|
||||
execution data at the end of first execution and crash on the second
|
||||
execution)
|
||||
*/
|
||||
for (SELECT_LEX *sl= un->first_select(); sl; sl= sl->next_select())
|
||||
sl->uncacheable |= UNCACHEABLE_DEPENDENT;
|
||||
}
|
||||
else
|
||||
un->uncacheable&= ~UNCACHEABLE_DEPENDENT;
|
||||
subquery_predicate->is_correlated= is_correlated_unit;
|
||||
}
|
||||
|
Reference in New Issue
Block a user