My Project
Public Member Functions | Public Attributes
Item_func_between Class Reference
Inheritance diagram for Item_func_between:
Item_func_opt_neg Item_int_func Item_func Item_result_field Item

List of all members.

Public Member Functions

 Item_func_between (Item *a, Item *b, Item *c)
longlong val_int ()
optimize_type select_optimize () const
enum Functype functype () const
const char * func_name () const
bool fix_fields (THD *, Item **)
void fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_select)
void fix_length_and_dec ()
virtual void print (String *str, enum_query_type query_type)
bool is_bool_func ()
const CHARSET_INFO * compare_collation ()
uint decimal_precision () const

Public Attributes

Item_result cmp_type
String value0
String value1
String value2
bool compare_as_dates_with_strings
bool compare_as_temporal_dates
bool compare_as_temporal_times
Arg_comparator ge_cmp
Arg_comparator le_cmp

Member Function Documentation

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

bool Item_func_between::fix_fields ( THD *  thd,
Item **  ref 
) [virtual]

Perform context analysis of a BETWEEN item tree.

This function performs context analysis (name resolution) and calculates various attributes of the item tree with Item_func_between as its root. The function saves in ref the pointer to the item or to a newly created item that is considered as a replacement for the original one.

Parameters:
thdreference to the global context of the query thread
refpointer to Item* variable where pointer to resulting "fixed" item is to be assigned
Note:
Let T0(e)/T1(e) be the value of not_null_tables(e) when e is used on a predicate/function level. Then it's easy to show that:
      T0(e BETWEEN e1 AND e2)     = union(T1(e),T1(e1),T1(e2))
      T1(e BETWEEN e1 AND e2)     = union(T1(e),intersection(T1(e1),T1(e2)))
      T0(e NOT BETWEEN e1 AND e2) = union(T1(e),intersection(T1(e1),T1(e2)))
      T1(e NOT BETWEEN e1 AND e2) = union(T1(e),intersection(T1(e1),T1(e2)))
    
Return values:
0ok
1got error

Reimplemented from Item_func.

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


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