~drizzle-trunk/drizzle/development

642.1.1 by Lee
move functions from item.cc/item.h to item directory
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
642.1.1 by Lee
move functions from item.cc/item.h to item directory
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
#ifndef DRIZZLED_ITEM_FIELD_H
21
#define DRIZZLED_ITEM_FIELD_H
22
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
23
namespace drizzled
24
{
25
642.1.1 by Lee
move functions from item.cc/item.h to item directory
26
extern Item **not_found_item;
27
class COND_EQUAL;
28
29
class Item_field :public Item_ident
30
{
31
protected:
32
  void set_field(Field *field);
33
public:
34
  Field *field,*result_field;
35
  Item_equal *item_equal;
36
  bool no_const_subst;
37
  /*
38
    if any_privileges set to true then here real effective privileges will
39
    be stored
40
  */
41
  uint32_t have_privileges;
42
  /* field need any privileges (for VIEW creation) */
43
  bool any_privileges;
44
  Item_field(Name_resolution_context *context_arg,
45
             const char *db_arg,const char *table_name_arg,
46
	     const char *field_name_arg);
47
  /*
48
    Constructor needed to process subselect with temporary tables (see Item)
49
  */
50
  Item_field(Session *session, Item_field *item);
51
  /*
52
    Constructor used inside setup_wild(), ensures that field, table,
53
    and database names will live as long as Item_field (this is important
54
    in prepared statements).
55
  */
56
  Item_field(Session *session, Name_resolution_context *context_arg, Field *field);
57
  /*
58
    If this constructor is used, fix_fields() won't work, because
59
    db_name, table_name and column_name are unknown. It's necessary to call
60
    reset_field() before fix_fields() for all fields created this way.
61
  */
62
  Item_field(Field *field);
63
  enum Type type() const { return FIELD_ITEM; }
64
  bool eq(const Item *item, bool binary_cmp) const;
65
  double val_real();
66
  int64_t val_int();
2030.1.4 by Brian Aker
Change my_decimal to Decimal
67
  type::Decimal *val_decimal(type::Decimal *);
642.1.1 by Lee
move functions from item.cc/item.h to item directory
68
  String *val_str(String*);
69
  double val_result();
70
  int64_t val_int_result();
71
  String *str_result(String* tmp);
2030.1.4 by Brian Aker
Change my_decimal to Decimal
72
  type::Decimal *val_decimal_result(type::Decimal *);
642.1.1 by Lee
move functions from item.cc/item.h to item directory
73
  bool val_bool_result();
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
74
  bool send(plugin::Client *client, String *str_arg);
642.1.1 by Lee
move functions from item.cc/item.h to item directory
75
  void reset_field(Field *f);
76
  bool fix_fields(Session *, Item **);
846 by Brian Aker
Removing on typedeffed class.
77
  void fix_after_pullout(Select_Lex *new_parent, Item **ref);
1052.2.4 by Nathan Williams
No actual code changes. Changed Send_field to SendField to be consistent with coding standards.
78
  void make_field(SendField *tmp_field);
642.1.1 by Lee
move functions from item.cc/item.h to item directory
79
  int save_in_field(Field *field,bool no_conversions);
80
  void save_org_in_field(Field *field);
81
  table_map used_tables() const;
82
  enum Item_result result_type () const;
83
  Item_result cast_to_int_type() const;
84
  enum_field_types field_type() const;
85
  int64_t val_int_endpoint(bool left_endp, bool *incl_endp);
86
  Field *get_tmp_table_field() { return result_field; }
87
  Field *tmp_table_field(Table *) { return result_field; }
2030.1.5 by Brian Aker
Update for moving DRIZZLE_TIME to type::Time
88
  bool get_date(type::Time *ltime,uint32_t fuzzydate);
89
  bool get_date_result(type::Time *ltime,uint32_t fuzzydate);
90
  bool get_time(type::Time *ltime);
642.1.1 by Lee
move functions from item.cc/item.h to item directory
91
  bool is_null();
92
  void update_null_value();
93
  Item *get_tmp_table_item(Session *session);
94
  bool collect_item_field_processor(unsigned char * arg);
95
  bool find_item_in_field_list_processor(unsigned char *arg);
96
  bool register_field_in_read_map(unsigned char *arg);
97
  void cleanup();
98
  bool result_as_int64_t();
99
  Item_equal *find_item_equal(COND_EQUAL *cond_equal);
100
  bool subst_argument_checker(unsigned char **arg);
101
  Item *equal_fields_propagator(unsigned char *arg);
102
  bool set_no_const_sub(unsigned char *arg);
103
  Item *replace_equal_field(unsigned char *arg);
104
  uint32_t max_disp_length();
105
  Item *safe_charset_converter(const CHARSET_INFO * const tocs);
106
  int fix_outer_field(Session *session, Field **field, Item **reference);
107
  virtual Item *update_value_transformer(unsigned char *select_arg);
108
  virtual void print(String *str, enum_query_type query_type);
109
110
  friend class Item_default_value;
111
  friend class Item_insert_value;
848 by Brian Aker
typdef class removal (just... use the name of the class).
112
  friend class Select_Lex_Unit;
642.1.1 by Lee
move functions from item.cc/item.h to item directory
113
};
114
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
115
} /* namespace drizzled */
116
642.1.1 by Lee
move functions from item.cc/item.h to item directory
117
#endif /* DRIZZLED_ITEM_FIELD_H */