MWL#90: Address review feedback part #18
This commit is contained in:
parent
409902f884
commit
151207134b
@ -371,12 +371,6 @@ public:
|
||||
See also THD::emb_on_expr_nest.
|
||||
*/
|
||||
TABLE_LIST *emb_on_expr_nest;
|
||||
/*
|
||||
Location of the subquery predicate. It is either
|
||||
- pointer to join nest if the subquery predicate is in the ON expression
|
||||
- (TABLE_LIST*)1 if the predicate is in the WHERE.
|
||||
*/
|
||||
//TABLE_LIST *expr_join_nest;
|
||||
/*
|
||||
Types of left_expr and subquery's select list allow to perform subquery
|
||||
materialization. Currently, we set this to FALSE when it as well could
|
||||
@ -402,6 +396,18 @@ public:
|
||||
TRUE<=>this is a flattenable semi-join, false overwise.
|
||||
*/
|
||||
bool is_flattenable_semijoin;
|
||||
|
||||
/*
|
||||
Used to determine how this subselect item is represented in the item tree,
|
||||
in case there is a need to locate it there and replace with something else.
|
||||
Two options are possible:
|
||||
1. This item is there 'as-is'.
|
||||
1. This item is wrapped within Item_in_optimizer.
|
||||
*/
|
||||
Item *original_item()
|
||||
{
|
||||
return is_flattenable_semijoin ? (Item*)this : (Item*)optimizer;
|
||||
}
|
||||
|
||||
bool *get_cond_guard(int i)
|
||||
{
|
||||
|
@ -712,16 +712,7 @@ bool convert_join_subqueries_to_semijoins(JOIN *join)
|
||||
{
|
||||
Item **tree= ((*in_subq)->emb_on_expr_nest == NO_JOIN_NEST)?
|
||||
&join->conds : &((*in_subq)->emb_on_expr_nest->on_expr);
|
||||
Item *replace_me= *in_subq;
|
||||
/*
|
||||
JTBM: the subquery was already mapped with Item_in_optimizer, so we
|
||||
should search for that, not for original Item_in_subselect.
|
||||
TODO: what about delaying that rewrite until here?
|
||||
*/
|
||||
if (!(*in_subq)->is_flattenable_semijoin)
|
||||
{
|
||||
replace_me= (*in_subq)->optimizer;
|
||||
}
|
||||
Item *replace_me= (*in_subq)->original_item();
|
||||
if (replace_where_subcondition(join, tree, replace_me, new Item_int(1),
|
||||
FALSE))
|
||||
DBUG_RETURN(TRUE); /* purecov: inspected */
|
||||
@ -756,18 +747,7 @@ skip_conversion:
|
||||
bool do_fix_fields= !(*in_subq)->substitution->fixed;
|
||||
Item **tree= ((*in_subq)->emb_on_expr_nest == NO_JOIN_NEST)?
|
||||
&join->conds : &((*in_subq)->emb_on_expr_nest->on_expr);
|
||||
|
||||
Item *replace_me= *in_subq;
|
||||
/*
|
||||
JTBM: the subquery was already mapped with Item_in_optimizer, so we
|
||||
should search for that, not for original Item_in_subselect.
|
||||
TODO: what about delaying that rewrite until here?
|
||||
*/
|
||||
if (!(*in_subq)->is_flattenable_semijoin)
|
||||
{
|
||||
replace_me= (*in_subq)->optimizer;
|
||||
}
|
||||
|
||||
Item *replace_me= (*in_subq)->original_item();
|
||||
if (replace_where_subcondition(join, tree, replace_me, substitute,
|
||||
do_fix_fields))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user