My Project
Public Member Functions
Item_row Class Reference
Inheritance diagram for Item_row:
Item

List of all members.

Public Member Functions

 Item_row (List< Item > &)
 Item_row (Item *head, List< Item > &tail)
 Item_row (Item_row *item)
enum Type type () const
void illegal_method_call (const char *)
bool is_null ()
void make_field (Send_field *)
double val_real ()
longlong val_int ()
Stringval_str (String *)
my_decimalval_decimal (my_decimal *)
bool get_date (MYSQL_TIME *ltime, uint fuzzydate)
bool get_time (MYSQL_TIME *ltime)
bool fix_fields (THD *thd, Item **ref)
void fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_select)
void cleanup ()
void split_sum_func (THD *thd, Ref_ptr_array ref_pointer_array, List< Item > &fields)
table_map used_tables () const
bool const_item () const
enum Item_result result_type () const
void update_used_tables ()
table_map not_null_tables () const
virtual void print (String *str, enum_query_type query_type)
bool walk (Item_processor processor, bool walk_subquery, uchar *arg)
Itemtransform (Item_transformer transformer, uchar *arg)
uint cols ()
Itemelement_index (uint i)
Item ** addr (uint i)
bool check_cols (uint c)
bool null_inside ()
void bring_value ()

Constructor & Destructor Documentation

Item_row::Item_row ( List< Item > &  arg)

Row items used for comparing rows and IN operations on rows:

  (a, b, c) > (10, 10, 30)
  (a, b, c) = (select c, d, e, from t1 where x=12)
  (a, b, c) IN ((1,2,2), (3,4,5), (6,7,8)
  (a, b, c) IN (select c, d, e, from t1)
  
Todo:
think placing 2-3 component items in item (as it done for function

Member Function Documentation

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

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

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

Traverse item tree possibly transforming it (replacing items).

This function is designed to ease transformation of Item trees. Re-execution note: every such transformation is registered for rollback by THD::change_item_tree() and is rolled back at the end of execution by THD::rollback_item_tree_changes().

Therefore:

  • this function can not be used at prepared statement prepare (in particular, in fix_fields!), as only permanent transformation of Item trees are allowed at prepare.
  • the transformer function shall allocate new Items in execution memory root (thd->mem_root) and not anywhere else: allocated items will be gone in the end of execution.

If you don't need to transform an item tree, but only traverse it, please use Item::walk() instead.

Parameters:
transformerfunctor that performs transformation of a subtree
argopaque argument passed to the functor
Returns:
Returns pointer to the new subtree root. THD::change_item_tree() should be called for it if transformation took place, i.e. if a pointer to newly allocated item is returned.

Reimplemented from Item.


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