~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.h

  • Committer: Lee Bieber
  • Date: 2011-02-11 20:30:05 UTC
  • mfrom: (2157.1.3 build)
  • Revision ID: kalebral@gmail.com-20110211203005-757o1y2yf78dxzqr
Merge Stewart - 716848: drizzleimport displays wrong program_name
Merge Stewart - update README file
Merge Andrew and Joe - Exposes the InnoDB SYS_REPLICATION_LOG to data_dictionary so that it is fast and fixes many issues we have been having

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
/// TODO: Rename this file - func.h is stupid.
26
26
 
27
 
#include <drizzled/charset_info.h>
28
27
#include <drizzled/item.h>
 
28
#include <drizzled/sql_list.h>
29
29
#include <drizzled/item/bin_string.h>
30
 
#include <drizzled/lex_string.h>
31
 
#include <drizzled/sql_list.h>
32
 
#include <drizzled/type/decimal.h>
 
30
#include "drizzled/current_session.h"
33
31
 
34
 
#include <drizzled/visibility.h>
 
32
#include "drizzled/visibility.h"
35
33
 
36
34
namespace drizzled
37
35
{
48
46
    0 means get this number from first argument
49
47
  */
50
48
  uint32_t allowed_arg_cols;
51
 
 
52
49
public:
53
50
 
54
51
  using Item::split_sum_func;
73
70
  virtual enum Functype functype() const   { return UNKNOWN_FUNC; }
74
71
  virtual ~Item_func() {}
75
72
 
76
 
  Item_func(void);
 
73
  Item_func(void):
 
74
    _session(*current_session),
 
75
    allowed_arg_cols(1), arg_count(0),
 
76
    const_item_cache(false)
 
77
  {
 
78
    with_sum_func= 0;
 
79
    collation.set(DERIVATION_SYSCONST);
 
80
  }
77
81
 
78
 
  Item_func(Item *a);
79
 
  
80
 
  Item_func(Item *a,Item *b);
81
 
  
82
 
  Item_func(Item *a,Item *b,Item *c);
83
 
  
84
 
  Item_func(Item *a,Item *b,Item *c,Item *d);
85
 
  
86
 
  Item_func(Item *a,Item *b,Item *c,Item *d,Item* e);
 
82
  Item_func(Item *a):
 
83
    _session(*current_session),
 
84
    allowed_arg_cols(1), arg_count(1),
 
85
    const_item_cache(false)
 
86
  {
 
87
    args= tmp_arg;
 
88
    args[0]= a;
 
89
    with_sum_func= a->with_sum_func;
 
90
    collation.set(DERIVATION_SYSCONST);
 
91
  }
 
92
  
 
93
  Item_func(Item *a,Item *b):
 
94
    _session(*current_session),
 
95
    allowed_arg_cols(1), arg_count(2),
 
96
    const_item_cache(false)
 
97
  {
 
98
    args= tmp_arg;
 
99
    args[0]= a; args[1]= b;
 
100
    with_sum_func= a->with_sum_func || b->with_sum_func;
 
101
    collation.set(DERIVATION_SYSCONST);
 
102
  }
 
103
  
 
104
  Item_func(Item *a,Item *b,Item *c):
 
105
    _session(*current_session),
 
106
    allowed_arg_cols(1),
 
107
    const_item_cache(false)
 
108
  {
 
109
    arg_count= 0;
 
110
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*3)))
 
111
    {
 
112
      arg_count= 3;
 
113
      args[0]= a; args[1]= b; args[2]= c;
 
114
      with_sum_func= a->with_sum_func || b->with_sum_func || c->with_sum_func;
 
115
    }
 
116
    collation.set(DERIVATION_SYSCONST);
 
117
  }
 
118
  
 
119
  Item_func(Item *a,Item *b,Item *c,Item *d):
 
120
    _session(*current_session),
 
121
    allowed_arg_cols(1),
 
122
    const_item_cache(false)
 
123
  {
 
124
    arg_count= 0;
 
125
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*4)))
 
126
    {
 
127
      arg_count= 4;
 
128
      args[0]= a; args[1]= b; args[2]= c; args[3]= d;
 
129
      with_sum_func= a->with_sum_func || b->with_sum_func ||
 
130
        c->with_sum_func || d->with_sum_func;
 
131
    }
 
132
    collation.set(DERIVATION_SYSCONST);
 
133
  }
 
134
  
 
135
  Item_func(Item *a,Item *b,Item *c,Item *d,Item* e):
 
136
    _session(*current_session),
 
137
    allowed_arg_cols(1),
 
138
    const_item_cache(false)
 
139
  {
 
140
    arg_count= 5;
 
141
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*5)))
 
142
    {
 
143
      args[0]= a; args[1]= b; args[2]= c; args[3]= d; args[4]= e;
 
144
      with_sum_func= a->with_sum_func || b->with_sum_func ||
 
145
        c->with_sum_func || d->with_sum_func || e->with_sum_func ;
 
146
    }
 
147
    collation.set(DERIVATION_SYSCONST);
 
148
  }
87
149
  
88
150
  Item_func(List<Item> &list);
89
151