My Project
|
Public Member Functions | |
Item_in_optimizer (Item *a, Item_in_subselect *b) | |
bool | fix_fields (THD *, Item **) |
bool | fix_left (THD *thd, Item **ref) |
void | fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_select) |
bool | is_null () |
longlong | val_int () |
void | cleanup () |
const char * | func_name () const |
Item_cache ** | get_cache () |
void | keep_top_level_cache () |
Item * | transform (Item_transformer transformer, uchar *arg) |
void Item_in_optimizer::fix_after_pullout | ( | st_select_lex * | parent_select, |
st_select_lex * | removed_select | ||
) | [virtual] |
Fix after tables have been moved from one select_lex level to the parent level, e.g by semijoin conversion. Basically re-calculate all attributes dependent on the tables.
parent_select | select_lex that tables are moved to. |
removed_select | select_lex that tables are moved away from, child of parent_select. |
Reimplemented from Item_func.
Item * Item_in_optimizer::transform | ( | Item_transformer | transformer, |
uchar * | argument | ||
) | [virtual] |
Transform an Item_in_optimizer and its arguments with a callback function.
transformer | the transformer callback function to be applied to the nodes of the tree of the object |
parameter | to be passed to the transformer |
Recursively transform the left and the right operand of this Item. The Right operand is an Item_in_subselect or its subclass. To avoid the creation of new Items, we use the fact the the left operand of the Item_in_subselect is the same as the one of 'this', so instead of transforming its operand, we just assign the left operand of the Item_in_subselect to be equal to the left operand of 'this'. The transformation is not applied further to the subquery operand if the IN predicate.
pointer | to the transformed item |
NULL | if an error occurred |
Reimplemented from Item_func.
longlong Item_in_optimizer::val_int | ( | void | ) | [virtual] |
The implementation of optimized <outer expression> [NOT] IN <subquery> predicates. It applies to predicates which have gone through the IN->EXISTS transformation in in_to_exists_transformer functions; not to subquery materialization (which has no triggered conditions).
The implementation works as follows. For the current value of the outer expression
( oc_1, ..., oc_n ) <in predicate> ( SELECT ic_1, ..., ic_n FROM <table> WHERE <inner where> )
was transformed into
( oc_1, ..., oc_n ) <in predicate> ( SELECT ic_1, ..., ic_n FROM <table> WHERE <inner where> AND ... ( ic_k = oc_k OR ic_k IS NULL ) HAVING ... NOT ic_k IS NULL )
The evaluation will now proceed according to special rules set up elsewhere. These rules include:
Implements Item.