You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
Merge pull request #1025 from mariadb-corporation/MCOL-3747
MCOL-3747 This patch properly enables queries with IN + uncorrelated …
This commit is contained in:
committed by
Patrick LeBlanc
parent
f27cb8a21f
commit
0db52396f9
@ -42,6 +42,26 @@ void disable_indices_for_CEJ(THD *thd_)
|
||||
}
|
||||
}
|
||||
|
||||
bool optimize_unflattened_subqueries_(SELECT_LEX *select_lex)
|
||||
{
|
||||
bool result = false;
|
||||
TABLE_LIST *tbl;
|
||||
List_iterator_fast<TABLE_LIST> li(select_lex->leaf_tables);
|
||||
while (!result && (tbl= li++))
|
||||
{
|
||||
if (tbl->is_view_or_derived())
|
||||
{
|
||||
SELECT_LEX *dsl = tbl->derived->first_select();
|
||||
result = optimize_unflattened_subqueries_(dsl);
|
||||
}
|
||||
}
|
||||
|
||||
result = (!result) ?
|
||||
select_lex->optimize_unflattened_subqueries(false) : true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void mutate_optimizer_flags(THD *thd_)
|
||||
{
|
||||
// MCOL-2178 Disable all optimizer flags as it was in the fork.
|
||||
@ -775,7 +795,9 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
|
||||
}
|
||||
|
||||
COND *conds = simplify_joins_(join, select_lex->join_list, join->conds, TRUE, FALSE);
|
||||
select_lex->optimize_unflattened_subqueries(false);
|
||||
// MCOL-3747 IN-TO-EXISTS rewrite inside MDB didn't add
|
||||
// an equi-JOIN condition.
|
||||
optimize_unflattened_subqueries_(select_lex);
|
||||
|
||||
if (conds)
|
||||
{
|
||||
|
Reference in New Issue
Block a user