~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_system_var.cc

  • Committer: Monty Taylor
  • Date: 2009-04-14 19:16:51 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 994.
  • Revision ID: mordred@inaugust.com-20090414191651-ltbww6hpqks8k7qk
Clarified instructions in README.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
 
20
#include <drizzled/server_includes.h>
 
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;
76
73
    return 0;
77
74
  if (component.str)
78
75
  {
79
 
    my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), base_name->str);
80
 
    return 0;
 
76
    if (!var->is_struct())
 
77
    {
 
78
      my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), base_name->str);
 
79
      return 0;
 
80
    }
81
81
  }
82
82
 
83
83
  set_if_smaller(component_name->length, (size_t)MAX_SYS_VAR_LENGTH);
86
86
                                      NULL, 0);
87
87
}
88
88
 
89
 
 
90
 
} /* namespace drizzled */