Drizzled Public API Documentation

field.h
1 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3  *
4  * Copyright (C) 2008 Sun Microsystems, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #pragma once
21 
22 #include <drizzled/item/ident.h>
23 
24 namespace drizzled {
25 
26 class COND_EQUAL;
27 
28 extern Item **not_found_item;
29 
30 class Item_field :public Item_ident
31 {
32 protected:
33  void set_field(Field *field);
34 public:
35  Field *field,*result_field;
36  Item_equal *item_equal;
37  bool no_const_subst;
38  /*
39  if any_privileges set to true then here real effective privileges will
40  be stored
41  */
42  uint32_t have_privileges;
43  /* field need any privileges (for VIEW creation) */
44  bool any_privileges;
46  const char *db_arg,const char *table_name_arg,
47  const char *field_name_arg);
48  /*
49  Constructor needed to process subselect with temporary tables (see Item)
50  */
51  Item_field(Session *session, Item_field *item);
52  /*
53  Constructor used inside setup_wild(), ensures that field, table,
54  and database names will live as long as Item_field (this is important
55  in prepared statements).
56  */
57  Item_field(Session *session, Name_resolution_context *context_arg, Field *field);
58  /*
59  If this constructor is used, fix_fields() won't work, because
60  db_name, table_name and column_name are unknown. It's necessary to call
61  reset_field() before fix_fields() for all fields created this way.
62  */
63  Item_field(Field *field);
64  enum Type type() const { return FIELD_ITEM; }
65  bool eq(const Item *item, bool binary_cmp) const;
66  double val_real();
67  int64_t val_int();
70  double val_result();
71  int64_t val_int_result();
72  String *str_result(String* tmp);
73  type::Decimal *val_decimal_result(type::Decimal *);
74  bool val_bool_result();
75  void send(plugin::Client *client, String *str_arg);
76  void reset_field(Field *f);
77  bool fix_fields(Session *, Item **);
78  void fix_after_pullout(Select_Lex *new_parent, Item **ref);
79  void make_field(SendField *tmp_field);
80  int save_in_field(Field *field,bool no_conversions);
81  void save_org_in_field(Field *field);
82  table_map used_tables() const;
83  enum Item_result result_type () const;
84  Item_result cast_to_int_type() const;
85  enum_field_types field_type() const;
86  int64_t val_int_endpoint(bool left_endp, bool *incl_endp);
87  Field *get_tmp_table_field() { return result_field; }
88  Field *tmp_table_field(Table *) { return result_field; }
89  bool get_date(type::Time &ltime,uint32_t fuzzydate);
90  bool get_date_result(type::Time &ltime, uint32_t fuzzydate);
91  bool get_time(type::Time &ltime);
92  bool is_null();
93  void update_null_value();
94  Item *get_tmp_table_item(Session *session);
95  bool collect_item_field_processor(unsigned char * arg);
96  bool find_item_in_field_list_processor(unsigned char *arg);
97  bool register_field_in_read_map(unsigned char *arg);
98  void cleanup();
99  bool result_as_int64_t();
100  Item_equal *find_item_equal(COND_EQUAL *cond_equal);
101  bool subst_argument_checker(unsigned char **arg);
102  Item *equal_fields_propagator(unsigned char *arg);
103  bool set_no_const_sub(unsigned char *arg);
104  Item *replace_equal_field(unsigned char *arg);
105  uint32_t max_disp_length();
106  Item *safe_charset_converter(const charset_info_st * const tocs);
107  int fix_outer_field(Session *session, Field **field, Item **reference);
108  virtual Item *update_value_transformer(unsigned char *select_arg);
109  virtual void print(String *str);
110 
111  friend class Item_default_value;
112  friend class Item_insert_value;
113  friend class Select_Lex_Unit;
114 };
115 
116 } /* namespace drizzled */
117 
type::Decimal * val_decimal(type::Decimal *)
Definition: field.cc:248
Item_equal * find_item_equal(COND_EQUAL *cond_equal)
Definition: field.cc:947
double val_real()
Definition: field.cc:230
virtual void print(String *str)
Definition: field.cc:1231
TODO: Rename this file - func.h is stupid.
void save_org_in_field(Field *field)
Definition: field.cc:1137
bool find_item_in_field_list_processor(unsigned char *arg)
Definition: field.cc:87
table_map used_tables() const
Definition: field.cc:380
bool get_time(type::Time &ltime)
Definition: field.cc:285
bool get_date(type::Time &ltime, uint32_t fuzzydate)
Definition: field.cc:264
bool set_no_const_sub(unsigned char *arg)
Definition: field.cc:1060
bool subst_argument_checker(unsigned char **arg)
Definition: field.cc:997
Definition: wakeup.h:27
String * val_str(String *)
Definition: field.cc:220
void fix_after_pullout(Select_Lex *new_parent, Item **ref)
Definition: field.cc:408
bool fix_fields(Session *, Item **)
Definition: field.cc:750
bool collect_item_field_processor(unsigned char *arg)
Definition: field.cc:57
void reset_field(Field *f)
Definition: field.cc:212
int64_t val_int()
Definition: field.cc:239
bool result_as_int64_t()
Definition: field.cc:923
void send(plugin::Client *client, String *str_arg)
Definition: field.cc:1170
void update_null_value()
Definition: field.cc:1176
Item * equal_fields_propagator(unsigned char *arg)
Definition: field.cc:1027
bool eq(const Item *item, bool binary_cmp) const
Definition: field.cc:353
Item * replace_equal_field(unsigned char *arg)
Definition: field.cc:1093
int fix_outer_field(Session *session, Field **field, Item **reference)
Definition: field.cc:481
int64_t val_int_endpoint(bool left_endp, bool *incl_endp)
Definition: field.cc:434