My Project
|
Public Member Functions | |
Item_equal (Item_field *f1, Item_field *f2) | |
Item_equal (Item *c, Item_field *f) | |
Item_equal (Item_equal *item_equal) | |
Item * | get_const () |
void | compare_const (Item *c) |
void | add (Item *c, Item_field *f) |
void | add (Item *c) |
void | add (Item_field *f) |
uint | members () |
bool | contains (Field *field) |
Item_field * | get_first () |
Item_field * | get_subst_item (const Item_field *field) |
void | merge (Item_equal *item) |
void | update_const () |
enum Functype | functype () const |
longlong | val_int () |
const char * | func_name () const |
optimize_type | select_optimize () const |
void | sort (Item_field_cmpfunc compare, void *arg) |
void | fix_length_and_dec () |
bool | fix_fields (THD *thd, Item **ref) |
void | update_used_tables () |
bool | walk (Item_processor processor, bool walk_subquery, uchar *arg) |
Item * | transform (Item_transformer transformer, uchar *arg) |
virtual void | print (String *str, enum_query_type query_type) |
const CHARSET_INFO * | compare_collation () |
virtual bool | equality_substitution_analyzer (uchar **arg) |
virtual Item * | equality_substitution_transformer (uchar *arg) |
Friends | |
class | Item_equal_iterator |
bool Item_equal::contains | ( | Field * | field | ) |
Check whether a field is referred in the multiple equality.
The function checks whether field is occurred in the Item_equal object .
field | field whose occurrence is to be checked |
1 | if nultiple equality contains a reference to field |
0 | otherwise |
Item * Item_equal::equality_substitution_transformer | ( | uchar * | arg | ) | [virtual] |
Transform an Item_equal object after having added a table that represents a materialized semi-join.
If the multiple equality represented by the Item_equal object contains a field from the subquery that was used to create the materialized table, add the corresponding key field from the materialized table to the multiple equality.
Reimplemented from Item.
Item_field* Item_equal::get_first | ( | ) | [inline] |
Get the first field of multiple equality, use for semantic checking.
First | field in the multiple equality. |
Item_field * Item_equal::get_subst_item | ( | const Item_field * | field | ) |
Get item that can be substituted for the supplied item.
field | field item to get substitution field for, which must be present within the multiple equality itself. |
Found | substitution item in the multiple equality. |
Get the first item of multiple equality that can be substituted for the given field item. In order to make semijoin materialization strategy work correctly we can't propagate equal fields between a materialized semijoin and the outer query (or any other semijoin) unconditionally. Thus the field is returned according to the following rules:
1) If the given field belongs to a materialized semijoin then the first field in the multiple equality which belongs to the same semijoin is returned. 2) If the given field doesn't belong to a materialized semijoin then the first field in the multiple equality is returned.
void Item_equal::merge | ( | Item_equal * | item | ) |
Join members of another Item_equal object.
The function actually merges two multiple equalities. After this operation the Item_equal object additionally contains the field items of another item of the type Item_equal. If the optional constant items are not equal the cond_false flag is set to 1.
item | multiple equality whose members are to be joined |
void Item_equal::print | ( | String * | str, |
enum_query_type | query_type | ||
) | [virtual] |
This method is used for to:
For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,
Reimplemented from Item_func.
void Item_equal::sort | ( | Item_field_cmpfunc | compare, |
void * | arg | ||
) |
Order field items in multiple equality according to a sorting criteria.
The function perform ordering of the field items in the Item_equal object according to the criteria determined by the cmp callback parameter. If cmp(item_field1,item_field2,arg)<0 than item_field1 must be placed after item_fiel2.
The function sorts field items by the exchange sort algorithm. The list of field items is looked through and whenever two neighboring members follow in a wrong order they are swapped. This is performed again and again until we get all members in a right order.
compare | function to compare field item |
arg | context extra parameter for the cmp function |
Item * Item_equal::transform | ( | Item_transformer | transformer, |
uchar * | argument | ||
) | [virtual] |
Transform an Item_func object with a transformer callback function.
The function recursively applies the transform method to each argument of the Item_func node. If the call of the method for an argument item returns a new item the old item is substituted for a new one. After this the transformer is applied to the root node of the Item_func object.
transformer | the transformer callback function to be applied to the nodes of the tree of the object |
argument | parameter to be passed to the transformer |
Reimplemented from Item_func.
void Item_equal::update_const | ( | ) |
Check appearance of new constant items in the multiple equality object.
The function checks appearance of new constant items among the members of multiple equalities. Each new constant item is compared with the designated constant item if there is any in the multiple equality. If there is none the first new constant item becomes designated.