00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <config.h>
00021
00022 #include <drizzled/item/uint.h>
00023 #include <drizzled/item/num.h>
00024 #include <drizzled/item/string.h>
00025 #include <drizzled/item/decimal.h>
00026
00027 namespace drizzled {
00028
00040 Item *Item_num::safe_charset_converter(const charset_info_st*)
00041 {
00042 char buf[64];
00043 String tmp(buf, sizeof(buf), &my_charset_bin);
00044 String* s= val_str(&tmp);
00045 Item_string* conv= new Item_string(s->ptr(), s->length(), s->charset());
00046 conv->str_value.copy();
00047 conv->str_value.mark_as_const();
00048 return conv;
00049 }
00050
00051 Item_num *Item_uint::neg()
00052 {
00053 Item_decimal *item= new Item_decimal(value, 1);
00054 return item->neg();
00055 }
00056
00057 }