00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <drizzled/function/func.h>
00023 #include <drizzled/lex_string.h>
00024
00025 namespace drizzled {
00026
00027 class Item_func_get_user_var :public Item_func
00028 {
00029 user_var_entry *var_entry;
00030 Item_result m_cached_result_type;
00031 Session &session;
00032
00033 public:
00034 str_ref name;
00035 Item_func_get_user_var(Session &session_arg, str_ref a) :
00036 Item_func(),
00037 m_cached_result_type(STRING_RESULT),
00038 session(session_arg),
00039 name(a)
00040 {}
00041 enum Functype functype() const { return GUSERVAR_FUNC; }
00042 str_ref get_name() { return name; }
00043 double val_real();
00044 int64_t val_int();
00045 type::Decimal *val_decimal(type::Decimal*);
00046 String *val_str(String* str);
00047 void fix_length_and_dec();
00048 virtual void print(String *str);
00049 enum Item_result result_type() const;
00050
00051
00052
00053
00054 const char *func_name() const { return "get_user_var"; }
00055 bool const_item() const;
00056 table_map used_tables() const
00057 { return const_item() ? 0 : RAND_TABLE_BIT; }
00058 bool eq(const Item *item, bool binary_cmp) const;
00059 };
00060
00061 }
00062