~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.h

  • Committer: lbieber
  • Date: 2010-10-01 12:16:18 UTC
  • mfrom: (1802.1.1 fix-bug-651256)
  • Revision ID: lbieber@orisndriz08-20101001121618-uqcboygpjwbiglem
Merge Vijay - fix bug 651256 - Remove --help-extended

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
 
21
 
 
22
20
#ifndef DRIZZLED_FUNCTION_FUNC_H
23
21
#define DRIZZLED_FUNCTION_FUNC_H
24
22
 
25
23
/// TODO: Rename this file - func.h is stupid.
26
24
 
27
 
#include <drizzled/charset_info.h>
28
 
#include <drizzled/current_session.h>
29
25
#include <drizzled/item.h>
 
26
#include <drizzled/sql_list.h>
30
27
#include <drizzled/item/bin_string.h>
31
 
#include <drizzled/lex_string.h>
32
 
#include <drizzled/sql_list.h>
33
 
#include <drizzled/type/decimal.h>
34
 
 
35
 
#include "drizzled/visibility.h"
 
28
#include "drizzled/current_session.h"
36
29
 
37
30
namespace drizzled
38
31
{
39
32
 
40
 
class DRIZZLED_API Item_func :
41
 
  public Item_result_field
 
33
class Item_func :public Item_result_field
42
34
{
43
35
  Session &_session;
44
36
 
75
67
 
76
68
  Item_func(void):
77
69
    _session(*current_session),
78
 
    allowed_arg_cols(1), arg_count(0),
79
 
    const_item_cache(false)
 
70
    allowed_arg_cols(1), arg_count(0)
80
71
  {
81
72
    with_sum_func= 0;
82
73
    collation.set(DERIVATION_SYSCONST);
84
75
 
85
76
  Item_func(Item *a):
86
77
    _session(*current_session),
87
 
    allowed_arg_cols(1), arg_count(1),
88
 
    const_item_cache(false)
 
78
    allowed_arg_cols(1), arg_count(1)
89
79
  {
90
80
    args= tmp_arg;
91
81
    args[0]= a;
95
85
  
96
86
  Item_func(Item *a,Item *b):
97
87
    _session(*current_session),
98
 
    allowed_arg_cols(1), arg_count(2),
99
 
    const_item_cache(false)
 
88
    allowed_arg_cols(1), arg_count(2)
100
89
  {
101
90
    args= tmp_arg;
102
91
    args[0]= a; args[1]= b;
106
95
  
107
96
  Item_func(Item *a,Item *b,Item *c):
108
97
    _session(*current_session),
109
 
    allowed_arg_cols(1),
110
 
    const_item_cache(false)
 
98
    allowed_arg_cols(1)
111
99
  {
112
100
    arg_count= 0;
113
101
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*3)))
121
109
  
122
110
  Item_func(Item *a,Item *b,Item *c,Item *d):
123
111
    _session(*current_session),
124
 
    allowed_arg_cols(1),
125
 
    const_item_cache(false)
 
112
    allowed_arg_cols(1)
126
113
  {
127
114
    arg_count= 0;
128
115
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*4)))
137
124
  
138
125
  Item_func(Item *a,Item *b,Item *c,Item *d,Item* e):
139
126
    _session(*current_session),
140
 
    allowed_arg_cols(1),
141
 
    const_item_cache(false)
 
127
    allowed_arg_cols(1)
142
128
  {
143
129
    arg_count= 5;
144
130
    if ((args= (Item**) memory::sql_alloc(sizeof(Item*)*5)))
174
160
    {Sum}Functype and Item_func::functype()/Item_sum::sum_func()
175
161
    instead.
176
162
  */
177
 
  virtual const char *func_name() const { return NULL; }
 
163
  virtual const char *func_name() const { return NULL; };
178
164
  virtual bool const_item() const { return const_item_cache; }
179
165
  Item **arguments() const { return args; }
180
166
  void set_arguments(List<Item> &list);
197
183
  void count_real_length();
198
184
  void count_decimal_length();
199
185
 
200
 
  bool get_arg0_date(type::Time &ltime, uint32_t fuzzy_date);
201
 
  bool get_arg0_time(type::Time &ltime);
 
186
  bool get_arg0_date(DRIZZLE_TIME *ltime, uint32_t fuzzy_date);
 
187
  bool get_arg0_time(DRIZZLE_TIME *ltime);
202
188
 
203
189
  bool is_null();
204
190
 
205
 
  virtual bool deterministic() const
206
 
  {
207
 
    return false;
208
 
  }
209
 
 
210
191
  void signal_divide_by_null();
211
192
 
212
193
  virtual Field *tmp_table_field() { return result_field; }
214
195
 
215
196
  Item *get_tmp_table_item(Session *session);
216
197
 
217
 
  type::Decimal *val_decimal(type::Decimal *);
 
198
  my_decimal *val_decimal(my_decimal *);
218
199
 
219
200
  bool agg_arg_collations(DTCollation &c, Item **items, uint32_t nitems,
220
201
                          uint32_t flags);