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 {
00029
00041 Item *Item_num::safe_charset_converter(const CHARSET_INFO * const)
00042 {
00043 Item_string *conv;
00044 char buf[64];
00045 String *s, tmp(buf, sizeof(buf), &my_charset_bin);
00046 s= val_str(&tmp);
00047 if ((conv= new Item_string(s->ptr(), s->length(), s->charset())))
00048 {
00049 conv->str_value.copy();
00050 conv->str_value.mark_as_const();
00051 }
00052 return conv;
00053 }
00054
00055 Item_num *Item_uint::neg()
00056 {
00057 Item_decimal *item= new Item_decimal(value, 1);
00058 return item->neg();
00059 }
00060
00061 }