My Project
Public Member Functions | Protected Attributes | Friends
Item_cond Class Reference
Inheritance diagram for Item_cond:
Item_bool_func Item_int_func Item_func Item_result_field Item Item_cond_and Item_cond_or

List of all members.

Public Member Functions

 Item_cond (Item *i1, Item *i2)
 Item_cond (THD *thd, Item_cond *item)
 Item_cond (List< Item > &nlist)
bool add (Item *item)
bool add_at_head (Item *item)
void add_at_head (List< Item > *nlist)
bool fix_fields (THD *, Item **ref)
void fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_select)
enum Type type () const
List< Item > * argument_list ()
table_map used_tables () const
void update_used_tables ()
virtual void print (String *str, enum_query_type query_type)
void split_sum_func (THD *thd, Ref_ptr_array ref_pointer_array, List< Item > &fields)
void top_level_item ()
void copy_andor_arguments (THD *thd, Item_cond *item, bool real_items=false)
bool walk (Item_processor processor, bool walk_subquery, uchar *arg)
Itemtransform (Item_transformer transformer, uchar *arg)
void traverse_cond (Cond_traverser, void *arg, traverse_order order)
void neg_arguments (THD *thd)
enum_field_types field_type () const
bool subst_argument_checker (uchar **arg)
Itemcompile (Item_analyzer analyzer, uchar **arg_p, Item_transformer transformer, uchar *arg_t)
virtual bool equality_substitution_analyzer (uchar **arg)

Protected Attributes

List< Itemlist
bool abort_on_null

Friends

int setup_conds (THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves, Item **conds)

Member Function Documentation

Item * Item_cond::compile ( Item_analyzer  analyzer,
uchar **  arg_p,
Item_transformer  transformer,
uchar *  arg_t 
) [virtual]

Compile Item_cond object with a processor and a transformer callback functions.

First the function applies the analyzer to the root node of the Item_func object. Then if the analyzer succeeeds (returns TRUE) the function recursively applies the compile method to member item of the condition list. If the call of the method for a member 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_cond object.

Parameters:
analyzerthe analyzer callback function to be applied to the nodes of the tree of the object
[in,out]arg_pparameter to be passed to the analyzer
transformerthe transformer callback function to be applied to the nodes of the tree of the object
arg_tparameter to be passed to the transformer
Returns:
Item returned as result of transformation of the node, the same item if no transformation applied, or NULL if transformation caused an error.

Reimplemented from Item_func.

void Item_cond::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.

Parameters:
parent_selectselect_lex that tables are moved to.
removed_selectselect_lex that tables are moved away from, child of parent_select.

Reimplemented from Item_func.

void Item_cond::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_cond::split_sum_func ( THD *  thd,
Ref_ptr_array  ref_pointer_array,
List< Item > &  fields 
) [virtual]

Move SUM items out from item tree and replace with reference.

The split is done to get an unique item for each SUM function so that we can easily find and calculate them. (Calculation done by update_sum_func() and copy_sum_funcs() in sql_select.cc)

Parameters:
thdThread handler
ref_pointer_arrayPointer to array of reference fields
fieldsAll fields in select
Note:
This function is run on all expression (SELECT list, WHERE, HAVING etc) that have or refer (HAVING) to a SUM expression.

Reimplemented from Item_func.

Item * Item_cond::transform ( Item_transformer  transformer,
uchar *  arg 
) [virtual]

Transform an Item_cond object with a transformer callback function.

The function recursively applies the transform method to each member item of the condition list. If the call of the method for a member 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_cond object.

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

Reimplemented from Item_func.


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