~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_system_var.cc

  • Committer: lbieber
  • Date: 2010-01-21 18:21:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1277.
  • Revision ID: lbieber@orisndriz08-20100121182139-h549us3gsysyyl0e
clean up japanese tests, remove tests that no longer apply.  In test-run.pl change mysql_version_id to drizzle_version_id

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include "config.h"
21
 
 
 
21
#include CSTDINT_H
22
22
#include <drizzled/error.h>
23
23
#include <drizzled/function/get_system_var.h>
24
24
#include <drizzled/session.h>
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
26
Item_func_get_system_var::
30
 
Item_func_get_system_var(sys_var *var_arg, sql_var_t var_type_arg,
 
27
Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
31
28
                       LEX_STRING *component_arg, const char *name_arg,
32
29
                       size_t name_len_arg)
33
30
  :var(var_arg), var_type(var_type_arg), component(*component_arg)
55
52
  return(0);
56
53
}
57
54
 
58
 
Item *get_system_var(Session *session, sql_var_t var_type, LEX_STRING name,
 
55
Item *get_system_var(Session *session, enum_var_type var_type, LEX_STRING name,
59
56
                     LEX_STRING component)
60
57
{
61
58
  sys_var *var;
72
69
    component_name= &component;                 // Empty string
73
70
  }
74
71
 
75
 
  if (!(var= find_sys_var(base_name->str, base_name->length)))
 
72
  if (!(var= find_sys_var(session, base_name->str, base_name->length)))
76
73
    return 0;
77
74
  if (component.str)
78
75
  {
79
76
    my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), base_name->str);
80
77
    return 0;
81
78
  }
82
 
  session->lex->setCacheable(false);
83
79
 
84
80
  set_if_smaller(component_name->length, (size_t)MAX_SYS_VAR_LENGTH);
85
81
 
87
83
                                      NULL, 0);
88
84
}
89
85
 
90
 
 
91
 
} /* namespace drizzled */