~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cached_item.cc

  • Committer: Jay Pipes
  • Date: 2009-11-19 18:58:35 UTC
  • mto: (1223.1.2 push)
  • mto: This revision was merged to the branch mainline in revision 1224.
  • Revision ID: jpipes@serialcoder-20091119185835-o59wyfjiet3keutu
Fixes some valgrind warnings regarding conditionals depending on unintialized variables.  Use initializer lists properly, dang it. :) Also, removed the new_Cached_item() function's use_result_field, as this was only used for views and was producing a valgrind warning unnecessarily.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
  Create right type of Cached_item for an item.
37
37
*/
38
38
 
39
 
Cached_item *new_Cached_item(Session *session, Item *item,
40
 
                             bool use_result_field)
 
39
Cached_item *new_Cached_item(Session *session, Item *item)
41
40
{
42
41
  if (item->real_item()->type() == Item::FIELD_ITEM &&
43
42
      !(((Item_field *) (item->real_item()))->field->flags & BLOB_FLAG))
44
43
  {
45
44
    Item_field *real_item= (Item_field *) item->real_item();
46
 
    Field *cached_field= use_result_field ? real_item->result_field :
47
 
                                            real_item->field;
 
45
    Field *cached_field= real_item->field;
48
46
    return new Cached_item_field(cached_field);
49
47
  }
50
48
  switch (item->result_type()) {