MySQL 5.6.14 Source Code Document
|
Public Member Functions | |
Item_field (Name_resolution_context *context_arg, const char *db_arg, const char *table_name_arg, const char *field_name_arg) | |
Item_field (THD *thd, Item_field *item) | |
Item_field (THD *thd, Name_resolution_context *context_arg, Field *field) | |
Item_field (Field *field) | |
enum Type | type () const |
bool | eq (const Item *item, bool binary_cmp) const |
double | val_real () |
longlong | val_int () |
longlong | val_time_temporal () |
longlong | val_date_temporal () |
my_decimal * | val_decimal (my_decimal *) |
String * | val_str (String *) |
double | val_result () |
longlong | val_int_result () |
longlong | val_time_temporal_result () |
longlong | val_date_temporal_result () |
String * | str_result (String *tmp) |
my_decimal * | val_decimal_result (my_decimal *) |
bool | val_bool_result () |
bool | is_null_result () |
bool | send (Protocol *protocol, String *str_arg) |
void | reset_field (Field *f) |
bool | fix_fields (THD *, Item **) |
void | make_field (Send_field *tmp_field) |
type_conversion_status | save_in_field (Field *field, bool no_conversions) |
void | save_org_in_field (Field *field) |
table_map | used_tables () const |
virtual table_map | resolved_used_tables () const |
enum Item_result | result_type () const |
enum Item_result | numeric_context_result_type () const |
Item_result | cast_to_int_type () const |
enum_field_types | field_type () const |
enum_monotonicity_info | get_monotonicity_info () const |
longlong | val_int_endpoint (bool left_endp, bool *incl_endp) |
Field * | get_tmp_table_field () |
Field * | tmp_table_field (TABLE *t_arg) |
bool | get_date (MYSQL_TIME *ltime, uint fuzzydate) |
bool | get_date_result (MYSQL_TIME *ltime, uint fuzzydate) |
bool | get_time (MYSQL_TIME *ltime) |
bool | get_timeval (struct timeval *tm, int *warnings) |
bool | is_null () |
void | update_null_value () |
Item * | get_tmp_table_item (THD *thd) |
bool | collect_item_field_processor (uchar *arg) |
bool | add_field_to_set_processor (uchar *arg) |
bool | remove_column_from_bitmap (uchar *arg) |
bool | find_item_in_field_list_processor (uchar *arg) |
bool | register_field_in_read_map (uchar *arg) |
bool | check_partition_func_processor (uchar *int_arg) |
void | cleanup () |
Item_equal * | find_item_equal (COND_EQUAL *cond_equal) |
bool | subst_argument_checker (uchar **arg) |
Item * | equal_fields_propagator (uchar *arg) |
bool | set_no_const_sub (uchar *arg) |
Item * | replace_equal_field (uchar *arg) |
uint32 | max_disp_length () |
Item_field * | field_for_view_update () |
Item * | safe_charset_converter (const CHARSET_INFO *tocs) |
int | fix_outer_field (THD *thd, Field **field, Item **reference) |
virtual Item * | update_value_transformer (uchar *select_arg) |
virtual bool | item_field_by_name_analyzer (uchar **arg) |
virtual Item * | item_field_by_name_transformer (uchar *arg) |
virtual void | print (String *str, enum_query_type query_type) |
bool | is_outer_field () const |
Field::geometry_type | get_geometry_type () const |
const CHARSET_INFO * | charset_for_protocol (void) const |
void | dbug_print () |
bool | push_to_non_agg_fields (st_select_lex *select_lex) |
Pushes the item to select_lex.non_agg_fields() and updates its marker. | |
Public Member Functions inherited from Item_ident | |
Item_ident (Name_resolution_context *context_arg, const char *db_name_arg, const char *table_name_arg, const char *field_name_arg) | |
Item_ident (THD *thd, Item_ident *item) | |
const char * | full_name () const |
virtual void | fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_select) |
bool | remove_dependence_processor (uchar *arg) |
virtual bool | change_context_processor (uchar *cntx) |
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 Field * | make_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_safe_in_field (Field *field) |
enum Item_result | temporal_with_date_as_number_result_type () const |
virtual enum_field_types | string_field_type () const |
longlong | val_temporal_by_field_type () |
longlong | val_temporal_with_round (enum_field_types type, uint8 dec) |
ulonglong | val_uint () |
virtual String * | val_str_ascii (String *str) |
virtual bool | val_bool () |
virtual String * | val_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 table_map | not_null_tables () const |
virtual bool | basic_const_item () const |
virtual Item * | clone_item () |
virtual cond_result | eq_cmp_result () const |
uint | float_length (uint decimals_par) const |
virtual uint | decimal_precision () const |
int | decimal_int_part () const |
virtual uint | time_precision () |
virtual uint | datetime_precision () |
virtual bool | const_item () const |
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) |
virtual void | update_used_tables () |
virtual void | split_sum_func (THD *thd, Ref_ptr_array ref_pointer_array, List< Item > &fields) |
void | split_sum_func2 (THD *thd, Ref_ptr_array ref_pointer_array, List< Item > &fields, Item **ref, bool skip_registered) |
virtual void | top_level_item () |
virtual void | set_result_field (Field *field) |
virtual bool | is_result_field () |
virtual bool | is_bool_func () |
virtual void | save_in_result_field (bool no_conversions) |
virtual void | no_rows_in_result () |
virtual Item * | copy_or_same (THD *thd) |
virtual Item * | copy_andor_structure (THD *thd, bool real_items=false) |
virtual Item * | real_item () |
virtual const CHARSET_INFO * | compare_collation () |
virtual bool | walk (Item_processor processor, bool walk_subquery, uchar *arg) |
virtual Item * | transform (Item_transformer transformer, uchar *arg) |
virtual Item * | compile (Item_analyzer analyzer, uchar **arg_p, Item_transformer transformer, uchar *arg_t) |
virtual void | traverse_cond (Cond_traverser traverser, void *arg, traverse_order order) |
virtual bool | intro_version (uchar *int_arg) |
virtual bool | remove_fixed (uchar *arg) |
virtual bool | cleanup_processor (uchar *arg) |
virtual bool | reset_query_id_processor (uchar *query_id_arg) |
virtual bool | find_item_processor (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 Item * | cache_const_expr_transformer (uchar *arg) |
virtual bool | equality_substitution_analyzer (uchar **arg) |
virtual Item * | equality_substitution_transformer (uchar *arg) |
virtual bool | explain_subquery_checker (uchar **arg) |
virtual Item * | explain_subquery_propagator (uchar *arg) |
virtual bool | check_valid_arguments_processor (uchar *bool_arg) |
virtual bool | find_function_processor (uchar *arg) |
virtual Item * | this_item () |
virtual const Item * | this_item () const |
virtual Item ** | this_item_addr (THD *thd, Item **addr_arg) |
virtual uint | cols () |
virtual Item * | element_index (uint i) |
virtual Item ** | addr (uint i) |
virtual bool | check_cols (uint c) |
virtual bool | null_inside () |
virtual void | bring_value () |
Field * | tmp_table_field_from_field_type (TABLE *table, bool fixed_length) |
virtual Item * | neg_transformer (THD *thd) |
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 |
String * | check_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) |
bool | is_blob_field () const |
virtual bool | has_subquery () const |
virtual bool | has_stored_program () const |
virtual bool | created_by_in2exists () const |
Whether this Item was created by the IN->EXISTS subquery transformation. |
Public Attributes | |
Field * | field |
Field * | result_field |
Item_equal * | item_equal |
bool | no_const_subst |
uint | have_privileges |
bool | any_privileges |
Public Attributes inherited from Item_ident | |
Name_resolution_context * | context |
const char * | db_name |
const char * | table_name |
const char * | field_name |
bool | alias_name_used |
uint | cached_field_index |
TABLE_LIST * | cached_table |
st_select_lex * | depended_from |
Public Attributes inherited from Item | |
uint | rsize |
String | str_value |
Item_name_string | item_name |
Item_name_string | orig_name |
Item * | next |
uint32 | max_length |
int | marker |
uint8 | decimals |
my_bool | maybe_null |
my_bool | null_value |
my_bool | unsigned_flag |
my_bool | with_sum_func |
my_bool | fixed |
DTCollation | collation |
Item_result | cmp_context |
Protected Member Functions | |
void | set_field (Field *field) |
Friends | |
class | Item_default_value |
class | Item_insert_value |
class | st_select_lex_unit |
Additional Inherited Members | |
Public Types inherited from Item | |
enum | Type { FIELD_ITEM = 0, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM, INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM, COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM, PROC_ITEM, COND_ITEM, REF_ITEM, FIELD_STD_ITEM, FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM, SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER, PARAM_ITEM, TRIGGER_FIELD_ITEM, DECIMAL_ITEM, XPATH_NODESET, XPATH_NODESET_CMP, VIEW_FIXER_ITEM } |
enum | cond_result { COND_UNDEF, COND_OK, COND_TRUE, COND_FALSE } |
enum | traverse_order { POSTFIX, PREFIX } |
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_INFO * | default_charset () |
Protected Attributes inherited from Item_ident | |
const char * | orig_db_name |
const char * | orig_table_name |
const char * | orig_field_name |
Item_field::Item_field | ( | THD * | thd, |
Item_field * | item | ||
) |
Item_field::Item_field | ( | THD * | thd, |
Name_resolution_context * | context_arg, | ||
Field * | f | ||
) |
Constructor used inside setup_wild().
Ensures that field, table, and database names will live as long as Item_field (this is important in prepared statements).
Definition at line 2414 of file item.cc.
|
virtual |
Store the pointer to this item field into a list if not already there.
The method is used by Item::walk to collect all unique Item_field objects from a tree of Items into a set of items represented as a list.
Item_cond::walk() and Item_func::walk() stop the evaluation of the processor function for its arguments once the processor returns true.Therefore in order to force this method being called for all item arguments in a condition the method must return false.
arg | pointer to a List<Item_field> |
Reimplemented from Item.
Definition at line 873 of file item.cc.
|
virtual |
This function is called when:
Reimplemented from Item.
Reimplemented in Item_insert_value, and Item_default_value.
Definition at line 2829 of file item.cc.
|
virtual |
Set a pointer to the multiple equality the field reference belongs to (if any).
The function looks for a multiple equality containing the field item among those referenced by arg. In the case such equality exists the function does the following. If the found multiple equality contains a constant, then the field reference is substituted for this constant, otherwise it sets a pointer to the multiple equality in the field item.
arg | reference to list of multiple equalities where the field (this object) is to be looked for |
Reimplemented from Item.
Definition at line 5718 of file item.cc.
Item_equal * Item_field::find_item_equal | ( | COND_EQUAL * | cond_equal | ) |
Find a field among specified multiple equalities.
The function first searches the field among multiple equalities of the current level (in the cond_equal->current_level list). If it fails, it continues searching in upper levels accessed through a pointer cond_equal->upper_levels. The search terminates as soon as a multiple equality containing the field is found.
cond_equal | reference to list of multiple equalities where the field (this object) is to be looked for |
Definition at line 5608 of file item.cc.
|
virtual |
Check if an Item_field references some field from a list of fields.
Check whether the Item_field represented by 'this' references any of the fields in the keyparts passed via 'arg'. Used with the method Item::walk() to test whether any keypart in a sequence of keyparts is referenced in an expression.
TRUE | if 'this' references the field 'arg' |
FALSE | otherwise |
Reimplemented from Item.
|
virtual |
Resolve the name of a column reference.
The method resolves the column reference represented by 'this' as a column present in one of: FROM clause, SELECT clause, GROUP BY clause of a query Q, or in outer queries that contain Q.
The name resolution algorithm used is (where [T_j] is an optional table name that qualifies the column name):
Notice that compared to Item_ref::fix_fields, here we first search the FROM clause, and then we search the SELECT and GROUP BY clauses.
[in] | thd | current thread |
[in,out] | reference | view column if this item was resolved to a view column |
TRUE | if error |
FALSE | on success |
Reimplemented from Item.
Reimplemented in Item_insert_value, and Item_default_value.
Definition at line 5325 of file item.cc.
Resolve the name of an outer select column reference.
The method resolves the column reference represented by 'this' as a column present in outer selects that contain current select.
In prepared statements, because of cache, find_field_in_tables() can resolve fields even if they don't belong to current context. In this case this method only finds appropriate context and marks current select as dependent. The found reference of field should be provided in 'from_field'.
[in] | thd | current thread |
[in,out] | from_field | found field reference or (Field*)not_found_field |
[in,out] | reference | view column if this item was resolved to a view column |
1 | column succefully resolved and fix_fields() should continue. |
0 | column fully fixed and fix_fields() should return FALSE |
-1 | error occured |
Definition at line 5003 of file item.cc.
|
virtual |
|
virtual |
Analyzer for finding Item_field by name
arg | Field name to search for |
Reimplemented from Item.
|
virtual |
Simple transformer that returns the argument if this is an Item_field. The new item will inherit it's name to maintain aliases.
arg | Item to replace Item_field |
Reimplemented from Item.
|
inlinevirtual |
Result type when an item appear in a numeric context. See Field::numeric_context_result_type() for more comments.
Reimplemented from Item.
Definition at line 2213 of file item.h.
|
virtual |
This method is used for to:
For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,
Reimplemented from Item_ident.
Reimplemented in Item_insert_value, and Item_default_value.
|
virtual |
Visitor interface for removing all column expressions (Item_field) in this expression tree from a bitmap. walk()
arg | A MY_BITMAP* cast to unsigned char*, where the bits represent Field::field_index values. |
Reimplemented from Item.
|
virtual |
Replace an Item_field for an equal Item_field that evaluated earlier (if any).
The function returns a pointer to an item that is taken from the very beginning of the item_equal list which the Item_field object refers to (belongs to) unless item_equal contains a constant item. In this case the function returns this constant item, (if the substitution does not require conversion). If the Item_field object does not refer any Item_equal object 'this' is returned .
arg | a dummy parameter, is not used here |
Reimplemented from Item.
Definition at line 5792 of file item.cc.
void Item_field::reset_field | ( | Field * | f | ) |
|
virtual |
Return used table information for the level this item is resolved on.
Reimplemented from Item.
|
virtual |
Save a temporal value in packed longlong format into a Field. Used in optimizer.
OUT | field The field to set the value to. |
0 | On success. |
>0 | In error. |
Reimplemented from Item.
Reimplemented in Item_insert_value, and Item_default_value.
Definition at line 6160 of file item.cc.
|
virtual |
|
virtual |
|
virtual |
Check whether a field can be substituted by an equal item.
The function checks whether a substitution of the field occurrence for an equal item is valid.
arg | *arg != NULL <-> the field is in the context where substitution for an equal item is valid |
TRUE | substitution is valid |
FALSE | otherwise |
Reimplemented from Item.
|
virtual |
|
virtual |
|
virtual |
|
virtual |