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 |
||
670.1.20
by Monty Taylor
Renamed functions to function... everything else is singular. |
20 |
#ifndef DRIZZLED_FUNCTION_USER_VAR_AS_OUT_PARAM_H
|
21 |
#define DRIZZLED_FUNCTION_USER_VAR_AS_OUT_PARAM_H
|
|
492.3.35
by Lee
more changes to move functions from item_func.cc/h to the functions directory |
22 |
|
670.1.20
by Monty Taylor
Renamed functions to function... everything else is singular. |
23 |
#include <drizzled/function/func.h> |
492.3.35
by Lee
more changes to move functions from item_func.cc/h to the functions directory |
24 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
25 |
namespace drizzled |
26 |
{
|
|
27 |
||
492.3.35
by Lee
more changes to move functions from item_func.cc/h to the functions directory |
28 |
/*
|
29 |
This item represents user variable used as out parameter (e.g in LOAD DATA),
|
|
30 |
and it is supposed to be used only for this purprose. So it is simplified
|
|
31 |
a lot. Actually you should never obtain its value.
|
|
32 |
||
33 |
The only two reasons for this thing being an Item is possibility to store it
|
|
34 |
in List<Item> and desire to place this code somewhere near other functions
|
|
35 |
working with user variables.
|
|
36 |
*/
|
|
37 |
class Item_user_var_as_out_param :public Item |
|
38 |
{
|
|
39 |
LEX_STRING name; |
|
40 |
user_var_entry *entry; |
|
41 |
public: |
|
42 |
Item_user_var_as_out_param(LEX_STRING a) : name(a) {} |
|
43 |
/* We should return something different from FIELD_ITEM here */
|
|
44 |
enum Type type() const { return STRING_ITEM;} |
|
45 |
double val_real(); |
|
46 |
int64_t val_int(); |
|
47 |
String *val_str(String *str); |
|
48 |
my_decimal *val_decimal(my_decimal *decimal_buffer); |
|
49 |
/* fix_fields() binds variable name with its entry structure */
|
|
50 |
bool fix_fields(Session *session, Item **ref); |
|
51 |
virtual void print(String *str, enum_query_type query_type); |
|
52 |
void set_null_value(const CHARSET_INFO * const cs); |
|
53 |
void set_value(const char *str, uint32_t length, const CHARSET_INFO * const cs); |
|
54 |
};
|
|
55 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
56 |
} /* namespace drizzled */ |
57 |
||
670.1.20
by Monty Taylor
Renamed functions to function... everything else is singular. |
58 |
#endif /* DRIZZLED_FUNCTION_USER_VAR_AS_OUT_PARAM_H */ |