~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.h

  • Committer: Brian Aker
  • Date: 2010-06-22 01:08:50 UTC
  • mto: This revision was merged to the branch mainline in revision 1635.
  • Revision ID: brian@gaz-20100622010850-eh2gi2i0e1kp0jye
Put a copy of the Session in the root of function to make use of.

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;
68
73
  }
 
74
 
69
75
  Item_func(Item *a):
 
76
    _session(*current_session),
70
77
    allowed_arg_cols(1), arg_count(1)
71
78
  {
72
79
    args= tmp_arg;
73
80
    args[0]= a;
74
81
    with_sum_func= a->with_sum_func;
75
82
  }
 
83
  
76
84
  Item_func(Item *a,Item *b):
 
85
    _session(*current_session),
77
86
    allowed_arg_cols(1), arg_count(2)
78
87
  {
79
88
    args= tmp_arg;
80
89
    args[0]= a; args[1]= b;
81
90
    with_sum_func= a->with_sum_func || b->with_sum_func;
82
91
  }
 
92
  
83
93
  Item_func(Item *a,Item *b,Item *c):
 
94
    _session(*current_session),
84
95
    allowed_arg_cols(1)
85
96
  {
86
97
    arg_count= 0;
91
102
      with_sum_func= a->with_sum_func || b->with_sum_func || c->with_sum_func;
92
103
    }
93
104
  }
 
105
  
94
106
  Item_func(Item *a,Item *b,Item *c,Item *d):
 
107
    _session(*current_session),
95
108
    allowed_arg_cols(1)
96
109
  {
97
110
    arg_count= 0;
103
116
        c->with_sum_func || d->with_sum_func;
104
117
    }
105
118
  }
 
119
  
106
120
  Item_func(Item *a,Item *b,Item *c,Item *d,Item* e):
 
121
    _session(*current_session),
107
122
    allowed_arg_cols(1)
108
123
  {
109
124
    arg_count= 5;
114
129
        c->with_sum_func || d->with_sum_func || e->with_sum_func ;
115
130
    }
116
131
  }
 
132
  
117
133
  Item_func(List<Item> &list);
 
134
  
118
135
  // Constructor used for Item_cond_and/or (see Item comment)
119
136
  Item_func(Session *session, Item_func *item);
 
137
  
120
138
  bool fix_fields(Session *, Item **ref);
121
139
  void fix_after_pullout(Select_Lex *new_parent, Item **ref);
122
140
  table_map used_tables() const;
188
206
                     void * arg, traverse_order order);
189
207
  double fix_result(double value);
190
208
 
 
209
  Session &getSession()
 
210
  {
 
211
    return _session;
 
212
  }
 
213
 
 
214
  Session *getSessionPtr()
 
215
  {
 
216
    return &_session;
 
217
  }
 
218
 
191
219
};
192
220
 
193
221
} /* namespace drizzled */