~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.cc

Merge in Joe's transaction id code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
  list.empty();          // Fields are used
60
60
}
61
61
 
62
 
Item_func::Item_func(List<Item> &list)
63
 
  :allowed_arg_cols(1)
 
62
Item_func::Item_func(List<Item> &list) :
 
63
  _session(*current_session),
 
64
  allowed_arg_cols(1)
64
65
{
 
66
  collation.set(DERIVATION_SYSCONST);
65
67
  set_arguments(list);
66
68
}
67
69
 
68
 
Item_func::Item_func(Session *session, Item_func *item)
69
 
  :Item_result_field(session, item),
70
 
   allowed_arg_cols(item->allowed_arg_cols),
71
 
   arg_count(item->arg_count),
72
 
   used_tables_cache(item->used_tables_cache),
73
 
   not_null_tables_cache(item->not_null_tables_cache),
74
 
   const_item_cache(item->const_item_cache)
 
70
Item_func::Item_func(Session *session, Item_func *item) :
 
71
  Item_result_field(session, item),
 
72
  _session(*current_session),
 
73
  allowed_arg_cols(item->allowed_arg_cols),
 
74
  arg_count(item->arg_count),
 
75
  used_tables_cache(item->used_tables_cache),
 
76
  not_null_tables_cache(item->not_null_tables_cache),
 
77
  const_item_cache(item->const_item_cache)
75
78
{
76
79
  if (arg_count)
77
80
  {
84
87
    }
85
88
    memcpy(args, item->args, sizeof(Item*)*arg_count);
86
89
  }
 
90
  collation.set(DERIVATION_SYSCONST);
87
91
}
88
92
 
89
93
 
279
283
        change records at each execution.
280
284
      */
281
285
      if (*arg != new_item)
282
 
        current_session->change_item_tree(arg, new_item);
 
286
        getSession().change_item_tree(arg, new_item);
283
287
    }
284
288
  }
285
289
  return (this->*transformer)(argument);
618
622
 
619
623
void Item_func::signal_divide_by_null()
620
624
{
621
 
  Session *session= current_session;
622
 
  push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO));
623
 
  null_value= 1;
 
625
  my_error(ER_DIVISION_BY_ZERO, MYF(0));
 
626
  null_value= 0;
624
627
}
625
628
 
626
629