~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.h

  • Committer: Brian Aker
  • Date: 2010-12-25 00:28:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2031.
  • Revision ID: brian@tangent.org-20101225002849-g73mg6ihulajis0o
First pass in refactoring of the name of my_decimal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_SET_VAR_H
21
21
#define DRIZZLED_SET_VAR_H
22
22
 
23
 
#include <boost/shared_ptr.hpp>
24
 
 
25
23
#include "drizzled/memory/sql_alloc.h"
26
24
#include "drizzled/sql_list.h"
27
25
#include "drizzled/lex_string.h"
53
51
  Classes for parsing of the SET command
54
52
****************************************************************************/
55
53
 
56
 
class set_var_base
 
54
class set_var_base :
 
55
  public memory::SqlAlloc
57
56
{
58
57
public:
59
58
  set_var_base() {}
67
66
class set_var :
68
67
  public set_var_base
69
68
{
70
 
  uint64_t uint64_t_value;
71
 
  std::string str_value;
72
69
public:
73
70
  sys_var *var;
74
71
  Item *value;
75
72
  sql_var_t type;
 
73
  union
 
74
  {
 
75
    const CHARSET_INFO *charset;
 
76
    uint32_t uint32_t_value;
 
77
    uint64_t uint64_t_value;
 
78
    size_t size_t_value;
 
79
    plugin::StorageEngine *storage_engine;
 
80
    Time_zone *time_zone;
 
81
    MY_LOCALE *locale_value;
 
82
  } save_result;
76
83
  LEX_STRING base;                      /* for structs */
77
84
 
78
85
  set_var(sql_var_t type_arg, sys_var *var_arg,
79
86
          const LEX_STRING *base_name_arg, Item *value_arg);
80
87
  int check(Session *session);
81
88
  int update(Session *session);
82
 
  void setValue(const std::string &new_value);
83
 
  void setValue(uint64_t new_value);
84
 
  void updateValue();
85
 
 
86
 
  uint64_t getInteger()
87
 
  {
88
 
    return uint64_t_value;
89
 
  }
90
 
 
91
89
};
92
90
 
93
91
/* User variables like @my_own_variable */
96
94
{
97
95
  Item_func_set_user_var *user_var_item;
98
96
public:
99
 
  explicit set_var_user(Item_func_set_user_var *item) :
 
97
  set_var_user(Item_func_set_user_var *item) :
100
98
    user_var_item(item)
101
99
  {}
102
100
  int check(Session *session);
103
101
  int update(Session *session);
104
102
};
105
103
 
106
 
typedef boost::shared_ptr<set_var_base> SetVarPtr;
107
 
typedef std::vector<SetVarPtr> SetVarVector;
108
 
int sql_set_variables(Session *session, const SetVarVector &var_list);
 
104
int sql_set_variables(Session *session, List<set_var_base> *var_list);
109
105
 
110
106
} /* namespace drizzled */
111
107