MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Item_equal Class Reference
Inheritance diagram for Item_equal:
Collaboration diagram for Item_equal:

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_INFOcompare_collation ()
virtual bool equality_substitution_analyzer (uchar **arg)
virtual Itemequality_substitution_transformer (uchar *arg)
- Public Member Functions inherited from Item_bool_func
 Item_bool_func (Item *a)
 Item_bool_func (Item *a, Item *b)
 Item_bool_func (THD *thd, Item_bool_func *item)
bool is_bool_func ()
uint decimal_precision () const
virtual bool created_by_in2exists () const
 Whether this Item was created by the IN->EXISTS subquery transformation.
void set_created_by_in2exists ()
- Public Member Functions inherited from Item_int_func
 Item_int_func (Item *a)
 Item_int_func (Item *a, Item *b)
 Item_int_func (Item *a, Item *b, Item *c)
 Item_int_func (List< Item > &list)
 Item_int_func (THD *thd, Item_int_func *item)
double val_real ()
Stringval_str (String *str)
bool get_date (MYSQL_TIME *ltime, uint fuzzydate)
bool get_time (MYSQL_TIME *ltime)
enum Item_result result_type () const
- Public Member Functions inherited from Item_func
enum Type type () const
 Item_func (Item *a)
 Item_func (Item *a, Item *b)
 Item_func (Item *a, Item *b, Item *c)
 Item_func (Item *a, Item *b, Item *c, Item *d)
 Item_func (Item *a, Item *b, Item *c, Item *d, Item *e)
 Item_func (List< Item > &list)
 Item_func (THD *thd, Item_func *item)
void fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_select)
table_map used_tables () const
virtual table_map get_initial_pseudo_tables () const
table_map not_null_tables () const
void set_used_tables (table_map map)
void set_not_null_tables (table_map map)
bool eq (const Item *item, bool binary_cmp) const
virtual bool have_rev_func () const
virtual Itemkey_item () const
virtual bool const_item () const
Item ** arguments () const
void set_arguments (List< Item > &list)
uint argument_count () const
void remove_arguments ()
void split_sum_func (THD *thd, Ref_ptr_array ref_pointer_array, List< Item > &fields)
void print_op (String *str, enum_query_type query_type)
void print_args (String *str, uint from, enum_query_type query_type)
virtual void fix_num_length_and_dec ()
void count_only_length (Item **item, uint nitems)
void count_real_length ()
void count_decimal_length ()
void count_datetime_length (Item **item, uint nitems)
bool count_string_result_length (enum_field_types field_type, Item **item, uint nitems)
bool get_arg0_date (MYSQL_TIME *ltime, uint fuzzy_date)
bool get_arg0_time (MYSQL_TIME *ltime)
bool is_null ()
void signal_divide_by_null ()
Fieldtmp_table_field ()
Fieldtmp_table_field (TABLE *t_arg)
Itemget_tmp_table_item (THD *thd)
my_decimalval_decimal (my_decimal *)
bool agg_arg_charsets (DTCollation &c, Item **items, uint nitems, uint flags, int item_sep)
bool agg_arg_charsets_for_string_result (DTCollation &c, Item **items, uint nitems, int item_sep=1)
bool agg_arg_charsets_for_comparison (DTCollation &c, Item **items, uint nitems, int item_sep=1)
bool agg_arg_charsets_for_string_result_with_comparison (DTCollation &c, Item **items, uint nitems, int item_sep=1)
Itemcompile (Item_analyzer analyzer, uchar **arg_p, Item_transformer transformer, uchar *arg_t)
void traverse_cond (Cond_traverser traverser, void *arg, traverse_order order)
double fix_result (double value)
void raise_numeric_overflow (const char *type_name)
double raise_float_overflow ()
longlong raise_integer_overflow ()
int raise_decimal_overflow ()
double check_float_overflow (double value)
longlong check_integer_overflow (longlong value, bool val_unsigned)
int check_decimal_overflow (int error)
bool has_timestamp_args ()
bool has_date_args ()
bool has_time_args ()
bool has_datetime_args ()
virtual bool check_valid_arguments_processor (uchar *bool_arg)
virtual bool find_function_processor (uchar *arg)
- Public Member Functions inherited from Item_result_field
 Item_result_field (THD *thd, Item_result_field *item)
Fieldget_tmp_table_field ()
void set_result_field (Field *field)
bool is_result_field ()
void save_in_result_field (bool no_conversions)
void cleanup ()
- Public Member Functions inherited from Item
 Item (THD *thd, Item *item)
void rename (char *new_name)
void init_make_field (Send_field *tmp_field, enum enum_field_types type)
virtual void make_field (Send_field *field)
virtual Fieldmake_string_field (TABLE *table)
void quick_fix_field ()
type_conversion_status save_in_field_no_warnings (Field *field, bool no_conversions)
virtual type_conversion_status save_in_field (Field *field, bool no_conversions)
virtual void save_org_in_field (Field *field)
virtual type_conversion_status save_safe_in_field (Field *field)
virtual bool send (Protocol *protocol, String *str)
virtual enum Item_result numeric_context_result_type () const
enum Item_result temporal_with_date_as_number_result_type () const
virtual Item_result cast_to_int_type () const
virtual enum_field_types string_field_type () const
virtual enum_field_types field_type () const
virtual enum_monotonicity_info get_monotonicity_info () const
virtual longlong val_int_endpoint (bool left_endp, bool *incl_endp)
virtual longlong val_date_temporal ()
virtual longlong val_time_temporal ()
longlong val_temporal_by_field_type ()
longlong val_temporal_with_round (enum_field_types type, uint8 dec)
ulonglong val_uint ()
virtual Stringval_str_ascii (String *str)
virtual bool val_bool ()
virtual Stringval_nodeset (String *)
type_conversion_status save_time_in_field (Field *field)
type_conversion_status save_date_in_field (Field *field)
type_conversion_status save_str_value_in_field (Field *field, String *result)
virtual const char * full_name () const
virtual double val_result ()
virtual longlong val_int_result ()
virtual longlong val_time_temporal_result ()
virtual longlong val_date_temporal_result ()
virtual Stringstr_result (String *tmp)
virtual my_decimalval_decimal_result (my_decimal *val)
virtual bool val_bool_result ()
virtual bool is_null_result ()
virtual table_map resolved_used_tables () const
virtual bool basic_const_item () const
virtual Itemclone_item ()
virtual cond_result eq_cmp_result () const
uint float_length (uint decimals_par) const
int decimal_int_part () const
virtual uint time_precision ()
virtual uint datetime_precision ()
virtual bool const_during_execution () const
void print_item_w_name (String *, enum_query_type query_type)
void print_for_order (String *str, enum_query_type query_type, bool used_alias)
void split_sum_func2 (THD *thd, Ref_ptr_array ref_pointer_array, List< Item > &fields, Item **ref, bool skip_registered)
virtual bool get_timeval (struct timeval *tm, int *warnings)
virtual bool get_date_result (MYSQL_TIME *ltime, uint fuzzydate)
virtual void update_null_value ()
virtual void top_level_item ()
virtual void no_rows_in_result ()
virtual Itemcopy_or_same (THD *thd)
virtual Itemcopy_andor_structure (THD *thd, bool real_items=false)
virtual Itemreal_item ()
virtual const CHARSET_INFOcharset_for_protocol (void) const
virtual bool intro_version (uchar *int_arg)
virtual bool remove_dependence_processor (uchar *arg)
virtual bool remove_fixed (uchar *arg)
virtual bool cleanup_processor (uchar *arg)
virtual bool collect_item_field_processor (uchar *arg)
virtual bool add_field_to_set_processor (uchar *arg)
virtual bool remove_column_from_bitmap (uchar *arg)
virtual bool find_item_in_field_list_processor (uchar *arg)
virtual bool change_context_processor (uchar *context)
virtual bool reset_query_id_processor (uchar *query_id_arg)
virtual bool find_item_processor (uchar *arg)
virtual bool register_field_in_read_map (uchar *arg)
virtual bool inform_item_in_cond_of_tab (uchar *join_tab_index)
virtual bool clean_up_after_removal (uchar *arg)
virtual bool cache_const_expr_analyzer (uchar **arg)
virtual Itemcache_const_expr_transformer (uchar *arg)
virtual bool item_field_by_name_analyzer (uchar **arg)
virtual Itemitem_field_by_name_transformer (uchar *arg)
virtual bool check_partition_func_processor (uchar *bool_arg)
virtual bool subst_argument_checker (uchar **arg)
virtual bool explain_subquery_checker (uchar **arg)
virtual Itemexplain_subquery_propagator (uchar *arg)
virtual Itemequal_fields_propagator (uchar *arg)
virtual bool set_no_const_sub (uchar *arg)
virtual Itemreplace_equal_field (uchar *arg)
virtual Itemthis_item ()
virtual const Itemthis_item () const
virtual Item ** this_item_addr (THD *thd, Item **addr_arg)
virtual uint cols ()
virtual Itemelement_index (uint i)
virtual Item ** addr (uint i)
virtual bool check_cols (uint c)
virtual bool null_inside ()
virtual void bring_value ()
Fieldtmp_table_field_from_field_type (TABLE *table, bool fixed_length)
virtual Item_fieldfield_for_view_update ()
virtual Itemneg_transformer (THD *thd)
virtual Itemupdate_value_transformer (uchar *select_arg)
virtual Itemsafe_charset_converter (const CHARSET_INFO *tocs)
void delete_self ()
virtual bool is_splocal ()
virtual
Settable_routine_parameter
get_settable_routine_parameter ()
bool is_temporal_with_date () const
bool is_temporal_with_date_and_time () const
bool is_temporal_with_time () const
bool is_temporal () const
bool has_compatible_context (Item *item) const
virtual Field::geometry_type get_geometry_type () const
Stringcheck_well_formed_result (String *str, bool send_error=0)
bool eq_by_collation (Item *item, bool binary_cmp, const CHARSET_INFO *cs)
virtual bool is_expensive ()
virtual bool can_be_evaluated_now () const
uint32 max_char_length () const
void fix_length_and_charset (uint32 max_char_length_arg, const CHARSET_INFO *cs)
void fix_char_length (uint32 max_char_length_arg)
void fix_char_length_ulonglong (ulonglong max_char_length_arg)
void fix_length_and_charset_datetime (uint32 max_char_length_arg)
void fix_length_and_dec_and_charset_datetime (uint32 max_char_length_arg, uint8 dec_arg)
virtual bool is_outer_field () const
bool is_blob_field () const
virtual bool has_subquery () const
virtual bool has_stored_program () const

Friends

class Item_equal_iterator

Additional Inherited Members

- Public Types inherited from Item_func
enum  Functype {
  UNKNOWN_FUNC, EQ_FUNC, EQUAL_FUNC, NE_FUNC,
  LT_FUNC, LE_FUNC, GE_FUNC, GT_FUNC,
  FT_FUNC, LIKE_FUNC, ISNULL_FUNC, ISNOTNULL_FUNC,
  COND_AND_FUNC, COND_OR_FUNC, XOR_FUNC, BETWEEN,
  IN_FUNC, MULT_EQUAL_FUNC, INTERVAL_FUNC, ISNOTNULLTEST_FUNC,
  SP_EQUALS_FUNC, SP_DISJOINT_FUNC, SP_INTERSECTS_FUNC, SP_TOUCHES_FUNC,
  SP_CROSSES_FUNC, SP_WITHIN_FUNC, SP_CONTAINS_FUNC, SP_OVERLAPS_FUNC,
  SP_STARTPOINT, SP_ENDPOINT, SP_EXTERIORRING, SP_POINTN,
  SP_GEOMETRYN, SP_INTERIORRINGN, NOT_FUNC, NOT_ALL_FUNC,
  NOW_FUNC, TRIG_COND_FUNC, SUSERVAR_FUNC, GUSERVAR_FUNC,
  COLLATE_FUNC, EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP,
  UDF_FUNC, NEG_FUNC, GSYSVAR_FUNC
}
enum  optimize_type {
  OPTIMIZE_NONE, OPTIMIZE_KEY, OPTIMIZE_OP, OPTIMIZE_NULL,
  OPTIMIZE_EQUAL
}
- Static Public Member Functions inherited from Item
static void * operator new (size_t size) throw ()
static void * operator new (size_t size, MEM_ROOT *mem_root) throw ()
static void operator delete (void *ptr, size_t size)
static void operator delete (void *ptr, MEM_ROOT *mem_root)
static const CHARSET_INFOdefault_charset ()
- Public Attributes inherited from Item_func
uint arg_count
- Protected Member Functions inherited from Item
Stringval_string_from_real (String *str)
Stringval_string_from_int (String *str)
Stringval_string_from_decimal (String *str)
Stringval_string_from_date (String *str)
Stringval_string_from_datetime (String *str)
Stringval_string_from_time (String *str)
my_decimalval_decimal_from_real (my_decimal *decimal_value)
my_decimalval_decimal_from_int (my_decimal *decimal_value)
my_decimalval_decimal_from_string (my_decimal *decimal_value)
my_decimalval_decimal_from_date (my_decimal *decimal_value)
my_decimalval_decimal_from_time (my_decimal *decimal_value)
longlong val_int_from_decimal ()
longlong val_int_from_date ()
longlong val_int_from_time ()
longlong val_int_from_datetime ()
double val_real_from_decimal ()
bool get_date_from_string (MYSQL_TIME *ltime, uint flags)
bool get_date_from_real (MYSQL_TIME *ltime, uint flags)
bool get_date_from_decimal (MYSQL_TIME *ltime, uint flags)
bool get_date_from_int (MYSQL_TIME *ltime, uint flags)
bool get_date_from_time (MYSQL_TIME *ltime)
bool get_date_from_numeric (MYSQL_TIME *ltime, uint fuzzydate)
bool get_date_from_non_temporal (MYSQL_TIME *ltime, uint fuzzydate)
bool get_time_from_string (MYSQL_TIME *ltime)
bool get_time_from_real (MYSQL_TIME *ltime)
bool get_time_from_decimal (MYSQL_TIME *ltime)
bool get_time_from_int (MYSQL_TIME *ltime)
bool get_time_from_date (MYSQL_TIME *ltime)
bool get_time_from_datetime (MYSQL_TIME *ltime)
bool get_time_from_numeric (MYSQL_TIME *ltime)
bool get_time_from_non_temporal (MYSQL_TIME *ltime)
- Protected Attributes inherited from Item_func
Item ** args
Itemtmp_arg [2]
bool const_item_cache
 Value used in calculation of result of const_item()
uint allowed_arg_cols
table_map used_tables_cache
 Value used in calculation of result of used_tables()
table_map not_null_tables_cache
 Value used in calculation of result of not_null_tables()

Detailed Description

Definition at line 1775 of file item_cmpfunc.h.

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

Definition at line 6078 of file item_cmpfunc.cc.

Here is the caller graph for this function:

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.

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

Reimplemented from Item.

Definition at line 6466 of file item_cmpfunc.cc.

Here is the call graph for this function:

Item_field* Item_equal::get_first ( )
inline

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

Return values
Firstfield in the multiple equality.

Definition at line 1807 of file item_cmpfunc.h.

Item_field * Item_equal::get_subst_item ( const Item_field field)

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.

Definition at line 6372 of file item_cmpfunc.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 6102 of file item_cmpfunc.cc.

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.

Definition at line 6285 of file item_cmpfunc.cc.

Here is the call graph for this function:

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

Definition at line 6136 of file item_cmpfunc.cc.

Here is the call graph for this function:

Here is the caller graph for this 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.

Definition at line 6261 of file item_cmpfunc.cc.

Here is the call graph for this function:

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.

Definition at line 6152 of file item_cmpfunc.cc.


The documentation for this class was generated from the following files: