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/item_result.h>
00025
00026 namespace drizzled {
00027
00028 class user_var_entry
00029 {
00030 public:
00031 user_var_entry(const char*, query_id_t id) :
00032 value(NULL),
00033 length(0),
00034 size(0),
00035 update_query_id(0),
00036 used_query_id(id),
00037 type(STRING_RESULT),
00038 unsigned_flag(false),
00039 collation(NULL, DERIVATION_IMPLICIT)
00040 {
00041 }
00042
00043 ~user_var_entry()
00044 {
00045 free(value);
00046 }
00047
00048 char* value;
00049 ulong length;
00050 size_t size;
00051 query_id_t update_query_id;
00052 query_id_t used_query_id;
00053 Item_result type;
00054 bool unsigned_flag;
00055 DTCollation collation;
00056
00057 double val_real(bool *null_value) const;
00058 int64_t val_int(bool *null_value) const;
00059 String *val_str(bool *null_value, String*, uint32_t decimals) const;
00060 type::Decimal *val_decimal(bool *null_value, type::Decimal *result) const;
00061
00062 void update_hash(bool set_null, data_ref, Item_result type, const charset_info_st* cs, Derivation dv, bool unsigned_arg);
00063 };
00064
00065 }
00066