492.3.35
by Lee
more changes to move functions from item_func.cc/h to the functions directory |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 Sun Microsystems
|
|
5 |
*
|
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; version 2 of the License.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
19 |
||
20 |
#ifndef DRIZZLED_FUNCTIONS_USER_VAR_AS_OUT_PARAM_H
|
|
21 |
#define DRIZZLED_FUNCTIONS_USER_VAR_AS_OUT_PARAM_H
|
|
22 |
||
23 |
#include <drizzled/functions/func.h> |
|
24 |
||
25 |
/*
|
|
26 |
This item represents user variable used as out parameter (e.g in LOAD DATA),
|
|
27 |
and it is supposed to be used only for this purprose. So it is simplified
|
|
28 |
a lot. Actually you should never obtain its value.
|
|
29 |
||
30 |
The only two reasons for this thing being an Item is possibility to store it
|
|
31 |
in List<Item> and desire to place this code somewhere near other functions
|
|
32 |
working with user variables.
|
|
33 |
*/
|
|
34 |
class Item_user_var_as_out_param :public Item |
|
35 |
{
|
|
36 |
LEX_STRING name; |
|
37 |
user_var_entry *entry; |
|
38 |
public: |
|
39 |
Item_user_var_as_out_param(LEX_STRING a) : name(a) {} |
|
40 |
/* We should return something different from FIELD_ITEM here */
|
|
41 |
enum Type type() const { return STRING_ITEM;} |
|
42 |
double val_real(); |
|
43 |
int64_t val_int(); |
|
44 |
String *val_str(String *str); |
|
45 |
my_decimal *val_decimal(my_decimal *decimal_buffer); |
|
46 |
/* fix_fields() binds variable name with its entry structure */
|
|
47 |
bool fix_fields(Session *session, Item **ref); |
|
48 |
virtual void print(String *str, enum_query_type query_type); |
|
49 |
void set_null_value(const CHARSET_INFO * const cs); |
|
50 |
void set_value(const char *str, uint32_t length, const CHARSET_INFO * const cs); |
|
51 |
};
|
|
52 |
||
53 |
#endif /* DRIZZLED_FUNCTIONS_USER_VAR_AS_OUT_PARAM_H */ |