~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/row.cc

merge lp:~linuxjedi/drizzle/trunk-remove-drizzleadmin

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
 
#include "config.h"
 
16
#include <config.h>
17
17
#include <drizzled/error.h>
18
18
#include <drizzled/session.h>
19
19
 
41
41
{
42
42
 
43
43
  //TODO: think placing 2-3 component items in item (as it done for function)
44
 
  if ((arg_count= arg.elements))
 
44
  if ((arg_count= arg.size()))
45
45
    items= (Item**) memory::sql_alloc(sizeof(Item*)*arg_count);
46
46
  else
47
47
    items= 0;
48
 
  List_iterator<Item> li(arg);
 
48
  List<Item>::iterator li(arg.begin());
49
49
  uint32_t i= 0;
50
50
  Item *item;
51
51
  while ((item= li++))
149
149
  return 0;
150
150
}
151
151
 
152
 
void Item_row::print(String *str, enum_query_type query_type)
 
152
void Item_row::print(String *str)
153
153
{
154
154
  str->append('(');
155
155
  for (uint32_t i= 0; i < arg_count; i++)
156
156
  {
157
157
    if (i)
158
158
      str->append(',');
159
 
    items[i]->print(str, query_type);
 
159
    items[i]->print(str);
160
160
  }
161
161
  str->append(')');
162
162
}
180
180
    Item *new_item= items[i]->transform(transformer, arg);
181
181
    if (!new_item)
182
182
      return 0;
183
 
 
184
 
    /*
185
 
      Session::change_item_tree() should be called only if the tree was
186
 
      really transformed, i.e. when a new item has been created.
187
 
      Otherwise we'll be allocating a lot of unnecessary memory for
188
 
      change records at each execution.
189
 
    */
190
 
    if (items[i] != new_item)
191
 
      getSession().change_item_tree(&items[i], new_item);
 
183
      items[i]= new_item;
192
184
  }
193
185
  return (this->*transformer)(arg);
194
186
}