~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.cc

  • Committer: Brian Aker
  • Date: 2010-06-22 01:08:50 UTC
  • mto: This revision was merged to the branch mainline in revision 1635.
  • Revision ID: brian@gaz-20100622010850-eh2gi2i0e1kp0jye
Put a copy of the Session in the root of function to make use of.

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
{
65
66
  set_arguments(list);
66
67
}
67
68
 
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)
 
69
Item_func::Item_func(Session *session, Item_func *item) :
 
70
  Item_result_field(session, item),
 
71
  _session(*current_session),
 
72
  allowed_arg_cols(item->allowed_arg_cols),
 
73
  arg_count(item->arg_count),
 
74
  used_tables_cache(item->used_tables_cache),
 
75
  not_null_tables_cache(item->not_null_tables_cache),
 
76
  const_item_cache(item->const_item_cache)
75
77
{
76
78
  if (arg_count)
77
79
  {
279
281
        change records at each execution.
280
282
      */
281
283
      if (*arg != new_item)
282
 
        current_session->change_item_tree(arg, new_item);
 
284
        getSession().change_item_tree(arg, new_item);
283
285
    }
284
286
  }
285
287
  return (this->*transformer)(argument);
618
620
 
619
621
void Item_func::signal_divide_by_null()
620
622
{
621
 
  Session *session= current_session;
622
 
  push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO));
 
623
  push_warning(getSessionPtr(), DRIZZLE_ERROR::WARN_LEVEL_ERROR, ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO));
623
624
  null_value= 1;
624
625
}
625
626