00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <config.h>
00021 #include <drizzled/item/cache_int.h>
00022
00023 namespace drizzled {
00024
00025 void Item_cache_int::store(Item *item)
00026 {
00027 value= item->val_int_result();
00028 null_value= item->null_value;
00029 unsigned_flag= item->unsigned_flag;
00030 }
00031
00032 void Item_cache_int::store(Item *item, int64_t val_arg)
00033 {
00034 value= val_arg;
00035 null_value= item->null_value;
00036 unsigned_flag= item->unsigned_flag;
00037 }
00038
00039 String *Item_cache_int::val_str(String *str)
00040 {
00041 assert(fixed == 1);
00042 str->set(value, default_charset());
00043 return str;
00044 }
00045
00046 type::Decimal *Item_cache_int::val_decimal(type::Decimal *decimal_val)
00047 {
00048 assert(fixed == 1);
00049 int2_class_decimal(E_DEC_FATAL_ERROR, value, unsigned_flag, decimal_val);
00050 return decimal_val;
00051 }
00052
00053 }