00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <drizzled/item/ident.h>
00023
00024 namespace drizzled
00025 {
00026
00027 class COND_EQUAL;
00028 class Item;
00029
00030 extern Item **not_found_item;
00031
00032 class Item_field :public Item_ident
00033 {
00034 protected:
00035 void set_field(Field *field);
00036 public:
00037 Field *field,*result_field;
00038 Item_equal *item_equal;
00039 bool no_const_subst;
00040
00041
00042
00043
00044 uint32_t have_privileges;
00045
00046 bool any_privileges;
00047 Item_field(Name_resolution_context *context_arg,
00048 const char *db_arg,const char *table_name_arg,
00049 const char *field_name_arg);
00050
00051
00052
00053 Item_field(Session *session, Item_field *item);
00054
00055
00056
00057
00058
00059 Item_field(Session *session, Name_resolution_context *context_arg, Field *field);
00060
00061
00062
00063
00064
00065 Item_field(Field *field);
00066 enum Type type() const { return FIELD_ITEM; }
00067 bool eq(const Item *item, bool binary_cmp) const;
00068 double val_real();
00069 int64_t val_int();
00070 type::Decimal *val_decimal(type::Decimal *);
00071 String *val_str(String*);
00072 double val_result();
00073 int64_t val_int_result();
00074 String *str_result(String* tmp);
00075 type::Decimal *val_decimal_result(type::Decimal *);
00076 bool val_bool_result();
00077 bool send(plugin::Client *client, String *str_arg);
00078 void reset_field(Field *f);
00079 bool fix_fields(Session *, Item **);
00080 void fix_after_pullout(Select_Lex *new_parent, Item **ref);
00081 void make_field(SendField *tmp_field);
00082 int save_in_field(Field *field,bool no_conversions);
00083 void save_org_in_field(Field *field);
00084 table_map used_tables() const;
00085 enum Item_result result_type () const;
00086 Item_result cast_to_int_type() const;
00087 enum_field_types field_type() const;
00088 int64_t val_int_endpoint(bool left_endp, bool *incl_endp);
00089 Field *get_tmp_table_field() { return result_field; }
00090 Field *tmp_table_field(Table *) { return result_field; }
00091 bool get_date(type::Time <ime,uint32_t fuzzydate);
00092 bool get_date_result(type::Time <ime, uint32_t fuzzydate);
00093 bool get_time(type::Time <ime);
00094 bool is_null();
00095 void update_null_value();
00096 Item *get_tmp_table_item(Session *session);
00097 bool collect_item_field_processor(unsigned char * arg);
00098 bool find_item_in_field_list_processor(unsigned char *arg);
00099 bool register_field_in_read_map(unsigned char *arg);
00100 void cleanup();
00101 bool result_as_int64_t();
00102 Item_equal *find_item_equal(COND_EQUAL *cond_equal);
00103 bool subst_argument_checker(unsigned char **arg);
00104 Item *equal_fields_propagator(unsigned char *arg);
00105 bool set_no_const_sub(unsigned char *arg);
00106 Item *replace_equal_field(unsigned char *arg);
00107 uint32_t max_disp_length();
00108 Item *safe_charset_converter(const CHARSET_INFO * const tocs);
00109 int fix_outer_field(Session *session, Field **field, Item **reference);
00110 virtual Item *update_value_transformer(unsigned char *select_arg);
00111 virtual void print(String *str);
00112
00113 friend class Item_default_value;
00114 friend class Item_insert_value;
00115 friend class Select_Lex_Unit;
00116 };
00117
00118 }
00119