22 #include <drizzled/item/cache_str.h>
23 #include <drizzled/field.h>
27 Item_cache_str::Item_cache_str(
const Item *item) :
28 Item_cache(), value(0),
29 is_varbinary(item->type() == FIELD_ITEM &&
30 ((const Item_field *) item)->field->type() ==
31 DRIZZLE_TYPE_VARCHAR &&
32 !((const Item_field *) item)->field->has_charset())
35 void Item_cache_str::store(Item *item)
37 value_buff.set(buffer,
sizeof(buffer), item->collation.collation);
38 value= item->str_result(&value_buff);
41 else if (value != &value_buff)
51 value_buff.copy(*value);
62 return my_strntod(value->charset(), (
char*) value->ptr(),
63 value->length(), &end_not_used, &err_not_used);
73 return my_strntoll(value->charset(), value->ptr(),
74 value->length(), 10, (
char**) 0, &err);
83 decimal_val->
store(E_DEC_FATAL_ERROR, value);
89 int Item_cache_str::save_in_field(
Field *field,
bool no_conversions)
91 return Item_cache::save_in_field(field, no_conversions);
int store(uint32_t mask, const char *from, uint32_t length, const charset_info_st *charset)
Convert string for decimal when string can be in some multibyte charset.
type::Decimal * val_decimal(type::Decimal *)