~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_system_var.cc

  • Committer: Brian Aker
  • Date: 2010-03-15 21:50:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1343.
  • Revision ID: brian@gaz-20100315215005-oqoblpbll9n0albj
Merge of table cache/def DD.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
22
22
#include <drizzled/error.h>
23
23
#include <drizzled/function/get_system_var.h>
24
24
#include <drizzled/session.h>
25
 
#include <drizzled/sys_var.h>
26
25
 
27
26
namespace drizzled
28
27
{
50
49
  */
51
50
  if (!(item= var->item(session, var_type, &component)))
52
51
    return(1);                             // Impossible
53
 
 
54
52
  item->set_name(name, 0, system_charset_info); // don't allocate a new name
55
53
  session->change_item_tree(ref, item);
56
54
 
74
72
    component_name= &component;                 // Empty string
75
73
  }
76
74
 
77
 
  if (!(var= find_sys_var(base_name->str)))
 
75
  if (!(var= find_sys_var(session, base_name->str, base_name->length)))
78
76
    return 0;
79
77
  if (component.str)
80
78
  {
81
79
    my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), base_name->str);
82
80
    return 0;
83
81
  }
84
 
  session->lex->setCacheable(false);
85
82
 
86
83
  set_if_smaller(component_name->length, (size_t)MAX_SYS_VAR_LENGTH);
87
84