22 #include <drizzled/error.h>
23 #include <drizzled/table.h>
24 #include <drizzled/session.h>
26 #include <drizzled/item/cache_row.h>
30 void Item_cache_row::make_field(SendField *)
32 illegal_method_call(
"make_field");
37 illegal_method_call(
"val");
43 illegal_method_call(
"val_int");
49 illegal_method_call(
"val_str");
55 illegal_method_call(
"val_decimal");
59 enum Item_result Item_cache_row::result_type()
const
64 uint32_t Item_cache_row::cols()
69 Item *Item_cache_row::element_index(uint32_t i)
74 Item **Item_cache_row::addr(uint32_t i)
76 return (
Item **) (values + i);
79 void Item_cache_row::allocate(uint32_t num)
82 values= (Item_cache **) getSession().mem.calloc(
sizeof(Item_cache *)*item_count);
85 bool Item_cache_row::setup(Item * item)
89 allocate(item->cols());
90 for (uint32_t i= 0; i < item_count; i++)
92 Item *el= item->element_index(i);
93 Item_cache *tmp= values[i]= Item_cache::get_cache(el);
101 void Item_cache_row::store(Item * item)
105 for (uint32_t i= 0; i < item_count; i++)
107 values[i]->store(item->element_index(i));
112 void Item_cache_row::illegal_method_call(
const char*)
115 my_error(ER_OPERAND_COLUMNS, MYF(0), 1);
118 bool Item_cache_row::check_cols(uint32_t c)
122 my_error(ER_OPERAND_COLUMNS, MYF(0), c);
128 bool Item_cache_row::null_inside()
130 for (uint32_t i= 0; i < item_count; i++)
132 if (values[i]->cols() > 1)
134 if (values[i]->null_inside())
147 void Item_cache_row::bring_value()
149 for (uint32_t i= 0; i < item_count; i++)
150 values[i]->bring_value();
154 void Item_cache_row::keep_array()
159 void Item_cache_row::cleanup()
161 Item_cache::cleanup();
163 memset(values, 0, item_count*
sizeof(
Item**));
TODO: Rename this file - func.h is stupid.
virtual void update_null_value()
type::Decimal * val_decimal(type::Decimal *val)
String * val_str(String *val)