1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-2178 Enable GBH by default.

We preserve union related condition blocks until UNION-capable smart handler.

    Removed a number of commented code blocks.

    Add projection list REAL and TIME constants, e.g
        SELECT TIME'10:20:30',  TIMESTAMP'2001-01-01 10:20:30',  DATE'2001-01-01' FROM cs1;

    Marked potentially useless block in ORDER BY processing for future removal.

    Removed string variables used for reconstructed query in the pre-1.4 fork.

    Removed cp_get_plan().

    GBH doesn't step in if SH processes the query.

    All smart handlers now correctly processes impossible WHERE and HAVING.
This commit is contained in:
Roman Nozdrin
2019-08-12 21:02:32 +03:00
parent a1d1bd7392
commit f0c83a4a1f
6 changed files with 82 additions and 403 deletions

View File

@ -149,17 +149,17 @@ create_calpont_group_by_handler(THD* thd, Query* query)
{
ha_calpont_group_by_handler* handler = NULL;
// same as thd->lex->current_select
SELECT_LEX *select_lex = query->from->select_lex;
// MCOL-2178 Disable SP support in the group_by_handler for now
// Check the session variable value to enable/disable use of
// group_by_handler
if (!get_group_by_handler(thd) || (thd->lex)->sphead)
// group_by_handler. There is no GBH if SH works for the query.
if (select_lex->select_h || !get_group_by_handler(thd) || (thd->lex)->sphead)
{
return handler;
}
// same as thd->lex->current_select
SELECT_LEX *select_lex = query->from->select_lex;
// Create a handler if query is valid. See comments for details.
if ( query->group_by || select_lex->with_sum_func )
{
@ -172,7 +172,7 @@ create_calpont_group_by_handler(THD* thd, Query* query)
unsupported_feature = select_lex->is_correlated;
// Impossible HAVING or WHERE
if ( ( !unsupported_feature && query->having && select_lex->having_value == Item::COND_FALSE )
if ( ( !unsupported_feature && select_lex->having_value == Item::COND_FALSE )
|| ( select_lex->cond_count > 0
&& select_lex->cond_value == Item::COND_FALSE ) )
{
@ -473,11 +473,10 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
}
// Impossible HAVING or WHERE
// WIP replace with function call
// TODO replace with function call
if ( unsupported_feature
|| ( select_lex->having && select_lex->having_value == Item::COND_FALSE )
|| ( select_lex->cond_count > 0
&& select_lex->cond_value == Item::COND_FALSE ) )
|| select_lex->having_value == Item::COND_FALSE
|| select_lex->cond_value == Item::COND_FALSE )
{
unsupported_feature = true;
}