1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00

MCOL-2165 This disables correlated subqueries processing in group_by_nahdler

handing the query back to the server.
This commit is contained in:
Roman Nozdrin
2019-02-14 13:58:48 +03:00
parent e849af0ce6
commit eef813982c

View File

@@ -1231,11 +1231,14 @@ void check_walk(const Item* item, void* arg)
* logical OR in the filter predicates * logical OR in the filter predicates
* Impossible WHERE * Impossible WHERE
* Impossible HAVING * Impossible HAVING
* Valid queries with the last two crashes the server if processed. * and there is either GROUP BY or aggregation function
* exists at the top level.
* Valid queries with the last two crashes the server if
* processed.
* Details are in server/sql/group_by_handler.h * Details are in server/sql/group_by_handler.h
* PARAMETERS: * PARAMETERS:
* thd - THD pointer. * thd - THD pointer
* query - Query structure, that describes the pushdowned query. * query - Query structure LFM in group_by_handler.h
* RETURN: * RETURN:
* group_by_handler if success * group_by_handler if success
* NULL in other case * NULL in other case
@@ -1254,29 +1257,48 @@ create_calpont_group_by_handler(THD* thd, Query* query)
&& ( query->group_by || select_lex->with_sum_func ) ) && ( query->group_by || select_lex->with_sum_func ) )
{ {
bool unsupported_feature = false; bool unsupported_feature = false;
// Impossible HAVING or WHERE // revisit SELECT_LEX for all units
if ( ( query->having && select_lex->having_value == Item::COND_FALSE ) for(TABLE_LIST* tl = query->from; !unsupported_feature && tl; tl = tl->next_global)
|| ( select_lex->cond_count > 0
&& select_lex->cond_value == Item::COND_FALSE ) )
{ {
unsupported_feature = true; select_lex = tl->select_lex;
} // Correlation subquery. Comming soon so fail on this yet.
unsupported_feature = select_lex->is_correlated;
// Unsupported conditions check. // Impossible HAVING or WHERE
if ( !unsupported_feature ) if ( ( !unsupported_feature && query->having && select_lex->having_value == Item::COND_FALSE )
{ || ( select_lex->cond_count > 0
JOIN *join = select_lex->join; && select_lex->cond_value == Item::COND_FALSE ) )
Item_cond *icp = 0;
if (join != 0)
icp = reinterpret_cast<Item_cond*>(join->conds);
if ( unsupported_feature == false
&& icp )
{ {
icp->traverse_cond(check_walk, &unsupported_feature, Item::POSTFIX); unsupported_feature = true;
} }
}
// Unsupported JOIN conditions
if ( !unsupported_feature )
{
JOIN *join = select_lex->join;
Item_cond *icp = 0;
if (join != 0)
icp = reinterpret_cast<Item_cond*>(join->conds);
if ( unsupported_feature == false
&& icp )
{
icp->traverse_cond(check_walk, &unsupported_feature, Item::POSTFIX);
}
// Optimizer could move some join conditions into where
if (select_lex->where != 0)
icp = reinterpret_cast<Item_cond*>(select_lex->where);
if ( unsupported_feature == false
&& icp )
{
icp->traverse_cond(check_walk, &unsupported_feature, Item::POSTFIX);
}
}
} // unsupported features check ends here
if ( !unsupported_feature ) if ( !unsupported_feature )
{ {