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

MCOL-4282 Follow up on the previous commit.

Activate statement arena for:
  1. disable_indices_for_CEJ()
  2. in_subselect_rewrite() for prepared statements
This commit is contained in:
Gagan Goel
2020-09-21 17:25:25 -04:00
parent 9693ecd28a
commit e257570b04
2 changed files with 19 additions and 4 deletions

View File

@ -276,6 +276,8 @@ void in_subselect_rewrite_walk(const Item* item_arg, void* arg)
*result= sub->create_in_to_exists_cond(join);
*result= (*result) ? *result :
sub->inject_in_to_exists_cond(join);
sub->unit->first_select()->prep_where=
join->conds ? join->conds->copy_andor_structure(current_thd) : 0;
}
else if (typeid(*item) == typeid(Item_singlerow_subselect))
{

View File

@ -796,8 +796,14 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
handler= new ha_columnstore_select_handler(thd, select_lex);
JOIN *join= select_lex->join;
{
Query_arena *arena, backup;
arena= thd->activate_stmt_arena_if_needed(&backup);
disable_indices_for_CEJ(thd);
if (arena)
thd->restore_active_arena(arena, &backup);
if (select_lex->handle_derived(thd->lex, DT_MERGE))
{
unsupported_feature = true;
@ -815,7 +821,6 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
if (sel->first_cond_optimization)
{
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
Query_arena *arena, backup;
arena= thd->activate_stmt_arena_if_needed(&backup);
sel->first_cond_optimization= false;
@ -826,7 +831,16 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
sel->where= conds;
if (isPS)
sel->prep_where= conds;
{
sel->prep_where= conds ? conds->copy_andor_structure(thd) : 0;
if (in_subselect_rewrite(sel))
{
unsupported_feature = true;
handler->err_msg.assign("create_columnstore_select_handler(): \
Internal error occured in in_subselect_rewrite()");
}
}
select_lex->update_used_tables();
@ -848,13 +862,12 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
// MCOL-3747 IN-TO-EXISTS rewrite inside MDB didn't add
// an equi-JOIN condition.
if (!unsupported_feature && in_subselect_rewrite(select_lex))
if (!unsupported_feature && !isPS && in_subselect_rewrite(select_lex))
{
unsupported_feature = true;
handler->err_msg.assign("create_columnstore_select_handler(): \
Internal error occured in in_subselect_rewrite()");
}
}
// We shouldn't raise error now so set an error to raise it later in init_SH.