22#include <drizzled/error.h>
23#include <drizzled/table.h>
24#include <drizzled/session.h>
26#include <drizzled/item/cache_row.h>
30void 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");
59enum Item_result Item_cache_row::result_type()
const
64uint32_t Item_cache_row::cols()
69Item *Item_cache_row::element_index(uint32_t i)
74Item **Item_cache_row::addr(uint32_t i)
76 return (
Item **) (values + i);
79void Item_cache_row::allocate(uint32_t num)
82 values= (Item_cache **) getSession().mem.calloc(
sizeof(Item_cache *)*item_count);
85bool 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);
101void Item_cache_row::store(
Item * item)
105 for (uint32_t i= 0; i < item_count; i++)
107 values[i]->store(item->element_index(i));
112void Item_cache_row::illegal_method_call(
const char*)
115 my_error(ER_OPERAND_COLUMNS, MYF(0), 1);
118bool Item_cache_row::check_cols(uint32_t c)
122 my_error(ER_OPERAND_COLUMNS, MYF(0), c);
128bool 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())
139 values[i]->update_null_value();
147void Item_cache_row::bring_value()
149 for (uint32_t i= 0; i < item_count; i++)
150 values[i]->bring_value();
154void Item_cache_row::keep_array()
159void Item_cache_row::cleanup()
161 Item_cache::cleanup();
163 memset(values, 0, item_count*
sizeof(
Item**));
type::Decimal * val_decimal(type::Decimal *val)
String * val_str(String *val)
TODO: Rename this file - func.h is stupid.