00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <drizzled/dtcollation.h>
00024 #include <drizzled/query_id.h>
00025
00026 namespace drizzled
00027 {
00028
00029 namespace type { class Decimal; }
00030
00031
00032 class user_var_entry
00033 {
00034 public:
00035 user_var_entry(const char *arg, query_id_t id) :
00036 value(0),
00037 length(0),
00038 size(0),
00039 update_query_id(0),
00040 used_query_id(id),
00041 type(STRING_RESULT),
00042 unsigned_flag(false),
00043 collation(NULL, DERIVATION_IMPLICIT)
00044 {
00045 name.str= strdup(arg);
00046 name.length= strlen(arg);
00047 }
00048
00049 ~user_var_entry()
00050 {
00051 if (name.str)
00052 free(name.str);
00053
00054 if (value)
00055 free(value);
00056 }
00057 LEX_STRING name;
00058 char *value;
00059 ulong length;
00060 size_t size;
00061 query_id_t update_query_id;
00062 query_id_t used_query_id;
00063 Item_result type;
00064 bool unsigned_flag;
00065
00066 double val_real(bool *null_value);
00067 int64_t val_int(bool *null_value) const;
00068 String *val_str(bool *null_value, String *str, uint32_t decimals);
00069 type::Decimal *val_decimal(bool *null_value, type::Decimal *result);
00070 DTCollation collation;
00071
00072 bool update_hash(bool set_null, void *ptr, uint32_t length,
00073 Item_result type, const CHARSET_INFO * const cs, Derivation dv,
00074 bool unsigned_arg);
00075 };
00076
00077 }
00078