1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
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.
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.
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
20
#ifndef DRIZZLED_ITEM_FIELD_H
21
#define DRIZZLED_ITEM_FIELD_H
23
#include <drizzled/item/ident.h>
31
extern Item **not_found_item;
33
class Item_field :public Item_ident
36
void set_field(Field *field);
38
Field *field,*result_field;
39
Item_equal *item_equal;
42
if any_privileges set to true then here real effective privileges will
45
uint32_t have_privileges;
46
/* field need any privileges (for VIEW creation) */
48
Item_field(Name_resolution_context *context_arg,
49
const char *db_arg,const char *table_name_arg,
50
const char *field_name_arg);
52
Constructor needed to process subselect with temporary tables (see Item)
54
Item_field(Session *session, Item_field *item);
56
Constructor used inside setup_wild(), ensures that field, table,
57
and database names will live as long as Item_field (this is important
58
in prepared statements).
60
Item_field(Session *session, Name_resolution_context *context_arg, Field *field);
62
If this constructor is used, fix_fields() won't work, because
63
db_name, table_name and column_name are unknown. It's necessary to call
64
reset_field() before fix_fields() for all fields created this way.
66
Item_field(Field *field);
67
enum Type type() const { return FIELD_ITEM; }
68
bool eq(const Item *item, bool binary_cmp) const;
71
type::Decimal *val_decimal(type::Decimal *);
72
String *val_str(String*);
74
int64_t val_int_result();
75
String *str_result(String* tmp);
76
type::Decimal *val_decimal_result(type::Decimal *);
77
bool val_bool_result();
78
bool send(plugin::Client *client, String *str_arg);
79
void reset_field(Field *f);
80
bool fix_fields(Session *, Item **);
81
void fix_after_pullout(Select_Lex *new_parent, Item **ref);
82
void make_field(SendField *tmp_field);
83
int save_in_field(Field *field,bool no_conversions);
84
void save_org_in_field(Field *field);
85
table_map used_tables() const;
86
enum Item_result result_type () const;
87
Item_result cast_to_int_type() const;
88
enum_field_types field_type() const;
89
int64_t val_int_endpoint(bool left_endp, bool *incl_endp);
90
Field *get_tmp_table_field() { return result_field; }
91
Field *tmp_table_field(Table *) { return result_field; }
92
bool get_date(type::Time <ime,uint32_t fuzzydate);
93
bool get_date_result(type::Time <ime, uint32_t fuzzydate);
94
bool get_time(type::Time <ime);
96
void update_null_value();
97
Item *get_tmp_table_item(Session *session);
98
bool collect_item_field_processor(unsigned char * arg);
99
bool find_item_in_field_list_processor(unsigned char *arg);
100
bool register_field_in_read_map(unsigned char *arg);
102
bool result_as_int64_t();
103
Item_equal *find_item_equal(COND_EQUAL *cond_equal);
104
bool subst_argument_checker(unsigned char **arg);
105
Item *equal_fields_propagator(unsigned char *arg);
106
bool set_no_const_sub(unsigned char *arg);
107
Item *replace_equal_field(unsigned char *arg);
108
uint32_t max_disp_length();
109
Item *safe_charset_converter(const CHARSET_INFO * const tocs);
110
int fix_outer_field(Session *session, Field **field, Item **reference);
111
virtual Item *update_value_transformer(unsigned char *select_arg);
112
virtual void print(String *str, enum_query_type query_type);
114
friend class Item_default_value;
115
friend class Item_insert_value;
116
friend class Select_Lex_Unit;
119
} /* namespace drizzled */
121
#endif /* DRIZZLED_ITEM_FIELD_H */