~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/cache_row.cc

  • Committer: Mark Atwood
  • Date: 2011-06-22 20:04:22 UTC
  • mfrom: (2318.6.39 rf)
  • Revision ID: me@mark.atwood.name-20110622200422-609npl456o0e5p32
mergeĀ lp:~olafvdspek/drizzle/refactor13

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
}
87
87
 
88
88
 
89
 
bool Item_cache_row::allocate(uint32_t num)
 
89
void Item_cache_row::allocate(uint32_t num)
90
90
{
91
91
  item_count= num;
92
 
  return (!(values=
93
 
            (Item_cache **) getSession().calloc(sizeof(Item_cache *)*item_count)));
 
92
  values= (Item_cache **) getSession().mem.calloc(sizeof(Item_cache *)*item_count);
94
93
}
95
94
 
96
95
 
97
96
bool Item_cache_row::setup(Item * item)
98
97
{
99
98
  example= item;
100
 
  if (!values && allocate(item->cols()))
101
 
    return 1;
 
99
  if (!values)
 
100
    allocate(item->cols());
102
101
  for (uint32_t i= 0; i < item_count; i++)
103
102
  {
104
103
    Item *el= item->element_index(i);
105
 
    Item_cache *tmp;
106
 
    if (!(tmp= values[i]= Item_cache::get_cache(el)))
 
104
    Item_cache *tmp= values[i]= Item_cache::get_cache(el);
 
105
    if (!tmp)
107
106
      return 1;
108
107
    tmp->setup(el);
109
108
  }