~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.h

  • Committer: Brian Aker
  • Date: 2011-01-18 07:21:16 UTC
  • mfrom: (2079.3.3 session-fix)
  • Revision ID: brian@tangent.org-20110118072116-nuflltzguzhq9rgg
Merge in update so that test-run.pl runs all of test/suite and fix for
create table like and FK.

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
 
23
25
#include "drizzled/memory/sql_alloc.h"
24
26
#include "drizzled/sql_list.h"
25
27
#include "drizzled/lex_string.h"
51
53
  Classes for parsing of the SET command
52
54
****************************************************************************/
53
55
 
54
 
class set_var_base :
55
 
  public memory::SqlAlloc
 
56
class set_var_base
56
57
{
57
58
public:
58
59
  set_var_base() {}
66
67
class set_var :
67
68
  public set_var_base
68
69
{
 
70
  uint64_t uint64_t_value;
 
71
  std::string str_value;
69
72
public:
70
73
  sys_var *var;
71
74
  Item *value;
72
75
  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;
83
76
  LEX_STRING base;                      /* for structs */
84
77
 
85
78
  set_var(sql_var_t type_arg, sys_var *var_arg,
86
79
          const LEX_STRING *base_name_arg, Item *value_arg);
87
80
  int check(Session *session);
88
81
  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
 
89
91
};
90
92
 
91
93
/* User variables like @my_own_variable */
94
96
{
95
97
  Item_func_set_user_var *user_var_item;
96
98
public:
97
 
  set_var_user(Item_func_set_user_var *item) :
 
99
  explicit set_var_user(Item_func_set_user_var *item) :
98
100
    user_var_item(item)
99
101
  {}
100
102
  int check(Session *session);
101
103
  int update(Session *session);
102
104
};
103
105
 
104
 
int sql_set_variables(Session *session, List<set_var_base> *var_list);
 
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);
105
109
 
106
110
} /* namespace drizzled */
107
111