drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
item/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
24namespace drizzled {
25
26class COND_EQUAL;
27
28extern Item **not_found_item;
29
30class Item_field :public Item_ident
31{
32protected:
33 void set_field(Field *field);
34public:
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;
45 Item_field(Name_resolution_context *context_arg,
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();
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
int64_t val_int_endpoint(bool left_endp, bool *incl_endp)
bool subst_argument_checker(unsigned char **arg)
String * val_str(String *)
bool set_no_const_sub(unsigned char *arg)
virtual void print(String *str)
bool get_date(type::Time &ltime, uint32_t fuzzydate)
void fix_after_pullout(Select_Lex *new_parent, Item **ref)
table_map used_tables() const
Item * equal_fields_propagator(unsigned char *arg)
bool find_item_in_field_list_processor(unsigned char *arg)
Definition item/field.cc:88
void reset_field(Field *f)
bool eq(const Item *item, bool binary_cmp) const
type::Decimal * val_decimal(type::Decimal *)
bool collect_item_field_processor(unsigned char *arg)
Definition item/field.cc:58
bool get_time(type::Time &ltime)
bool fix_fields(Session *, Item **)
Item_equal * find_item_equal(COND_EQUAL *cond_equal)
int fix_outer_field(Session *session, Field **field, Item **reference)
void save_org_in_field(Field *field)
void send(plugin::Client *client, String *str_arg)
Item * replace_equal_field(unsigned char *arg)
TODO: Rename this file - func.h is stupid.