~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_system_var.cc

  • Committer: Mark Atwood
  • Date: 2011-08-04 16:21:21 UTC
  • mfrom: (2318.9.14 refactor3)
  • Revision ID: me@mark.atwood.name-20110804162121-6b9ay1b1de3yfgvl
mergeĀ lp:~olafvdspek/drizzle/refactor3

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
  :var(var_arg), var_type(var_type_arg), component(*component_arg)
35
35
{
36
36
  /* set_name() will allocate the name */
37
 
  set_name(name_arg, name_len_arg, system_charset_info);
 
37
  set_name(name_arg, name_len_arg);
38
38
}
39
39
 
40
40
 
41
41
bool
42
42
Item_func_get_system_var::fix_fields(Session *session, Item **ref)
43
43
{
44
 
  Item *item;
45
44
 
46
45
  /*
47
46
    Evaluate the system variable and substitute the result (a basic constant)
48
47
    instead of this item. If the variable can not be evaluated,
49
48
    the error is reported in sys_var::item().
50
49
  */
51
 
  if (!(item= var->item(session, var_type, &component)))
 
50
  Item *item= var->item(session, var_type, &component);
 
51
  if (not item)
52
52
    return 1;                             // Impossible
53
53
 
54
 
  item->set_name(name, 0, system_charset_info); // don't allocate a new name
 
54
  item->set_name(name, 0); // don't allocate a new name
55
55
  *ref= item;
56
56
 
57
57
  return 0;