~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.h

Cleaned up name of calls around datachunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <drizzled/item.h>
26
26
#include <drizzled/sql_list.h>
27
27
#include <drizzled/item/bin_string.h>
 
28
#include "drizzled/current_session.h"
28
29
 
29
30
namespace drizzled
30
31
{
31
32
 
32
33
class Item_func :public Item_result_field
33
34
{
 
35
  Session &_session;
 
36
 
34
37
protected:
35
38
  Item **args, *tmp_arg[2];
36
39
  /*
61
64
  enum Type type() const { return FUNC_ITEM; }
62
65
  virtual enum Functype functype() const   { return UNKNOWN_FUNC; }
63
66
  virtual ~Item_func() {}
 
67
 
64
68
  Item_func(void):
 
69
    _session(*current_session),
65
70
    allowed_arg_cols(1), arg_count(0)
66
71
  {
67
72
    with_sum_func= 0;
 
73
    collation.set(DERIVATION_SYSCONST);
68
74
  }
 
75
 
69
76
  Item_func(Item *a):
 
77
    _session(*current_session),
70
78
    allowed_arg_cols(1), arg_count(1)
71
79
  {
72
80
    args= tmp_arg;
73
81
    args[0]= a;
74
82
    with_sum_func= a->with_sum_func;
 
83
    collation.set(DERIVATION_SYSCONST);
75
84
  }
 
85
  
76
86
  Item_func(Item *a,Item *b):
 
87
    _session(*current_session),
77
88
    allowed_arg_cols(1), arg_count(2)
78
89
  {
79
90
    args= tmp_arg;
80
91
    args[0]= a; args[1]= b;
81
92
    with_sum_func= a->with_sum_func || b->with_sum_func;
 
93
    collation.set(DERIVATION_SYSCONST);
82
94
  }
 
95
  
83
96
  Item_func(Item *a,Item *b,Item *c):
 
97
    _session(*current_session),
84
98
    allowed_arg_cols(1)
85
99
  {
86
100
    arg_count= 0;
90
104
      args[0]= a; args[1]= b; args[2]= c;
91
105
      with_sum_func= a->with_sum_func || b->with_sum_func || c->with_sum_func;
92
106
    }
 
107
    collation.set(DERIVATION_SYSCONST);
93
108
  }
 
109
  
94
110
  Item_func(Item *a,Item *b,Item *c,Item *d):
 
111
    _session(*current_session),
95
112
    allowed_arg_cols(1)
96
113
  {
97
114
    arg_count= 0;
102
119
      with_sum_func= a->with_sum_func || b->with_sum_func ||
103
120
        c->with_sum_func || d->with_sum_func;
104
121
    }
 
122
    collation.set(DERIVATION_SYSCONST);
105
123
  }
 
124
  
106
125
  Item_func(Item *a,Item *b,Item *c,Item *d,Item* e):
 
126
    _session(*current_session),
107
127
    allowed_arg_cols(1)
108
128
  {
109
129
    arg_count= 5;
113
133
      with_sum_func= a->with_sum_func || b->with_sum_func ||
114
134
        c->with_sum_func || d->with_sum_func || e->with_sum_func ;
115
135
    }
 
136
    collation.set(DERIVATION_SYSCONST);
116
137
  }
 
138
  
117
139
  Item_func(List<Item> &list);
 
140
  
118
141
  // Constructor used for Item_cond_and/or (see Item comment)
119
142
  Item_func(Session *session, Item_func *item);
 
143
  
120
144
  bool fix_fields(Session *, Item **ref);
121
145
  void fix_after_pullout(Select_Lex *new_parent, Item **ref);
122
146
  table_map used_tables() const;
188
212
                     void * arg, traverse_order order);
189
213
  double fix_result(double value);
190
214
 
 
215
  Session &getSession()
 
216
  {
 
217
    return _session;
 
218
  }
 
219
 
 
220
  Session *getSessionPtr()
 
221
  {
 
222
    return &_session;
 
223
  }
 
224
 
191
225
};
192
226
 
193
227
} /* namespace drizzled */