1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
4
* Copyright (C) 2008 Sun Microsystems, Inc.
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
20
#ifndef DRIZZLED_FUNCTION_GET_USER_VAR_H
21
#define DRIZZLED_FUNCTION_GET_USER_VAR_H
24
22
#include <drizzled/function/func.h>
23
#include <drizzled/lex_string.h>
26
27
class Item_func_get_user_var :public Item_func
28
29
user_var_entry *var_entry;
29
30
Item_result m_cached_result_type;
32
LEX_STRING name; // keep it public
33
Item_func_get_user_var(LEX_STRING a):
34
Item_func(), m_cached_result_type(STRING_RESULT), name(a) {}
34
str_ref name; // keep it public
35
Item_func_get_user_var(Session &session_arg, str_ref a) :
37
m_cached_result_type(STRING_RESULT),
35
41
enum Functype functype() const { return GUSERVAR_FUNC; }
36
LEX_STRING get_name() { return name; }
42
str_ref get_name() { return name; }
39
my_decimal *val_decimal(my_decimal*);
45
type::Decimal *val_decimal(type::Decimal*);
40
46
String *val_str(String* str);
41
47
void fix_length_and_dec();
42
virtual void print(String *str, enum_query_type query_type);
48
virtual void print(String *str);
43
49
enum Item_result result_type() const;
45
51
We must always return variables as strings to guard against selects of type