My Project
Public Member Functions | Friends
Item_equal Class Reference
Inheritance diagram for Item_equal:
Item_bool_func Item_int_func Item_func Item_result_field Item

List of all members.

Public Member Functions

 Item_equal (Item_field *f1, Item_field *f2)
 Item_equal (Item *c, Item_field *f)
 Item_equal (Item_equal *item_equal)
Itemget_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_fieldget_first ()
Item_fieldget_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)
Itemtransform (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 Itemequality_substitution_transformer (uchar *arg)

Friends

class Item_equal_iterator

Member Function Documentation

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 .

Parameters:
fieldfield whose occurrence is to be checked
Return values:
1if nultiple equality contains a reference to field
0otherwise

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.

See also:
JOIN::update_equalities_for_sjm() for the reason.

Reimplemented from Item.

Get the first field of multiple equality, use for semantic checking.

Return values:
Firstfield in the multiple equality.

Get item that can be substituted for the supplied item.

Parameters:
fieldfield item to get substitution field for, which must be present within the multiple equality itself.
Return values:
Foundsubstitution 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.

Parameters:
itemmultiple 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:

  • to generate a view definition query (SELECT-statement);
  • to generate a SQL-query for EXPLAIN EXTENDED;
  • to generate a SQL-query to be shown in INFORMATION_SCHEMA;
  • debug.

For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,

See also:
mysql_register_view().

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.

Parameters:
comparefunction to compare field item
argcontext 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.

Parameters:
transformerthe transformer callback function to be applied to the nodes of the tree of the object
argumentparameter to be passed to the transformer
Returns:
Item returned as the result of transformation of the root node

Reimplemented from Item_func.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines