~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.h

Moved the last of the libdrizzleclient calls into Protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/sql_list.h>
27
27
#include <drizzled/item/bin_string.h>
28
28
 
29
 
namespace drizzled
30
 
{
31
29
 
32
30
class Item_func :public Item_result_field
33
31
{
60
58
                       OPTIMIZE_EQUAL };
61
59
  enum Type type() const { return FUNC_ITEM; }
62
60
  virtual enum Functype functype() const   { return UNKNOWN_FUNC; }
63
 
  virtual ~Item_func() {}
64
61
  Item_func(void):
65
62
    allowed_arg_cols(1), arg_count(0)
66
63
  {
84
81
    allowed_arg_cols(1)
85
82
  {
86
83
    arg_count= 0;
87
 
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*3)))
 
84
    if ((args= (Item**) sql_alloc(sizeof(Item*)*3)))
88
85
    {
89
86
      arg_count= 3;
90
87
      args[0]= a; args[1]= b; args[2]= c;
95
92
    allowed_arg_cols(1)
96
93
  {
97
94
    arg_count= 0;
98
 
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*4)))
 
95
    if ((args= (Item**) sql_alloc(sizeof(Item*)*4)))
99
96
    {
100
97
      arg_count= 4;
101
98
      args[0]= a; args[1]= b; args[2]= c; args[3]= d;
107
104
    allowed_arg_cols(1)
108
105
  {
109
106
    arg_count= 5;
110
 
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*5)))
 
107
    if ((args= (Item**) sql_alloc(sizeof(Item*)*5)))
111
108
    {
112
109
      args[0]= a; args[1]= b; args[2]= c; args[3]= d; args[4]= e;
113
110
      with_sum_func= a->with_sum_func || b->with_sum_func ||
142
139
  void set_arguments(List<Item> &list);
143
140
  uint32_t argument_count() const { return arg_count; }
144
141
  void remove_arguments() { arg_count=0; }
145
 
 
146
 
  /**
147
 
   * Check if the UDF supports the number of arguments passed in
148
 
   * @param number of args
149
 
   */
150
 
  virtual bool check_argument_count(int) { return true ; }
151
142
  virtual void split_sum_func(Session *session, Item **ref_pointer_array,
152
143
                              List<Item> &fields);
153
144
 
190
181
 
191
182
};
192
183
 
193
 
} /* namespace drizzled */
194
 
 
195
184
 
196
185
#endif /* DRIZZLED_FUNCTION_FUNC_H */