~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.h

  • Committer: Stewart Smith
  • Date: 2011-03-29 01:30:47 UTC
  • mto: (2257.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2258.
  • Revision ID: stewart@flamingspork.com-20110329013047-5ujzfx6pahmwuko2
have CachedDirectory print out a warning if we can't stat() something in a directory. We should always have access to at least stat() things in directories Drizzle is running in (otherwise there is likely a problem)

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
 
#ifndef DRIZZLED_SET_VAR_H
21
 
#define DRIZZLED_SET_VAR_H
22
 
 
23
 
#include "drizzled/memory/sql_alloc.h"
24
 
#include "drizzled/sql_list.h"
25
 
#include "drizzled/lex_string.h"
26
 
 
27
 
namespace drizzled
28
 
{
 
20
#pragma once
 
21
 
 
22
#include <boost/shared_ptr.hpp>
 
23
 
 
24
#include <drizzled/enum.h>
 
25
#include <drizzled/lex_string.h>
 
26
 
 
27
namespace drizzled {
29
28
 
30
29
namespace plugin
31
30
{
32
 
class StorageEngine;
 
31
  class StorageEngine;
33
32
}
34
33
 
 
34
class Session;
35
35
class sys_var;
36
36
class Item;
37
37
class Item_func_set_user_var;
38
38
class Time_zone;
39
39
typedef struct my_locale_st MY_LOCALE;
40
 
typedef struct charset_info_st CHARSET_INFO;
41
40
 
42
41
/* Classes to support the SET command */
43
42
 
51
50
  Classes for parsing of the SET command
52
51
****************************************************************************/
53
52
 
54
 
class set_var_base :
55
 
  public memory::SqlAlloc
 
53
class set_var_base
56
54
{
57
55
public:
58
56
  set_var_base() {}
66
64
class set_var :
67
65
  public set_var_base
68
66
{
 
67
  uint64_t uint64_t_value;
 
68
  std::string str_value;
69
69
public:
70
70
  sys_var *var;
71
71
  Item *value;
72
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;
83
73
  LEX_STRING base;                      /* for structs */
84
74
 
85
75
  set_var(sql_var_t type_arg, sys_var *var_arg,
86
76
          const LEX_STRING *base_name_arg, Item *value_arg);
87
77
  int check(Session *session);
88
78
  int update(Session *session);
 
79
  void setValue(const std::string &new_value);
 
80
  void setValue(uint64_t new_value);
 
81
  void updateValue();
 
82
 
 
83
  uint64_t getInteger()
 
84
  {
 
85
    return uint64_t_value;
 
86
  }
 
87
 
89
88
};
90
89
 
91
90
/* User variables like @my_own_variable */
94
93
{
95
94
  Item_func_set_user_var *user_var_item;
96
95
public:
97
 
  set_var_user(Item_func_set_user_var *item) :
 
96
  explicit set_var_user(Item_func_set_user_var *item) :
98
97
    user_var_item(item)
99
98
  {}
100
99
  int check(Session *session);
101
100
  int update(Session *session);
102
101
};
103
102
 
104
 
int sql_set_variables(Session *session, List<set_var_base> *var_list);
 
103
typedef boost::shared_ptr<set_var_base> SetVarPtr;
 
104
typedef std::vector<SetVarPtr> SetVarVector;
 
105
int sql_set_variables(Session *session, const SetVarVector &var_list);
105
106
 
106
107
} /* namespace drizzled */
107
108
 
108
 
#endif /* DRIZZLED_SET_VAR_H */