You've already forked mariadb-columnstore-engine
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:
@ -276,6 +276,8 @@ void in_subselect_rewrite_walk(const Item* item_arg, void* arg)
|
|||||||
*result= sub->create_in_to_exists_cond(join);
|
*result= sub->create_in_to_exists_cond(join);
|
||||||
*result= (*result) ? *result :
|
*result= (*result) ? *result :
|
||||||
sub->inject_in_to_exists_cond(join);
|
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))
|
else if (typeid(*item) == typeid(Item_singlerow_subselect))
|
||||||
{
|
{
|
||||||
|
@ -796,8 +796,14 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
|
|||||||
handler= new ha_columnstore_select_handler(thd, select_lex);
|
handler= new ha_columnstore_select_handler(thd, select_lex);
|
||||||
JOIN *join= select_lex->join;
|
JOIN *join= select_lex->join;
|
||||||
{
|
{
|
||||||
|
Query_arena *arena, backup;
|
||||||
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
|
|
||||||
disable_indices_for_CEJ(thd);
|
disable_indices_for_CEJ(thd);
|
||||||
|
|
||||||
|
if (arena)
|
||||||
|
thd->restore_active_arena(arena, &backup);
|
||||||
|
|
||||||
if (select_lex->handle_derived(thd->lex, DT_MERGE))
|
if (select_lex->handle_derived(thd->lex, DT_MERGE))
|
||||||
{
|
{
|
||||||
unsupported_feature = true;
|
unsupported_feature = true;
|
||||||
@ -815,7 +821,6 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
|
|||||||
if (sel->first_cond_optimization)
|
if (sel->first_cond_optimization)
|
||||||
{
|
{
|
||||||
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
|
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
|
||||||
Query_arena *arena, backup;
|
|
||||||
arena= thd->activate_stmt_arena_if_needed(&backup);
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
sel->first_cond_optimization= false;
|
sel->first_cond_optimization= false;
|
||||||
|
|
||||||
@ -826,7 +831,16 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex)
|
|||||||
sel->where= conds;
|
sel->where= conds;
|
||||||
|
|
||||||
if (isPS)
|
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();
|
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
|
// MCOL-3747 IN-TO-EXISTS rewrite inside MDB didn't add
|
||||||
// an equi-JOIN condition.
|
// an equi-JOIN condition.
|
||||||
if (!unsupported_feature && in_subselect_rewrite(select_lex))
|
if (!unsupported_feature && !isPS && in_subselect_rewrite(select_lex))
|
||||||
{
|
{
|
||||||
unsupported_feature = true;
|
unsupported_feature = true;
|
||||||
handler->err_msg.assign("create_columnstore_select_handler(): \
|
handler->err_msg.assign("create_columnstore_select_handler(): \
|
||||||
Internal error occured in in_subselect_rewrite()");
|
Internal error occured in in_subselect_rewrite()");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We shouldn't raise error now so set an error to raise it later in init_SH.
|
// We shouldn't raise error now so set an error to raise it later in init_SH.
|
||||||
|
Reference in New Issue
Block a user