390.1.2
by Monty Taylor
Fixed copyright headers in drizzled/ |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
1999.6.1
by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file |
4 |
* Copyright (C) 2008 Sun Microsystems, Inc.
|
390.1.2
by Monty Taylor
Fixed copyright headers in drizzled/ |
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; version 2 of the License.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
1
by brian
clean slate |
19 |
|
1878.3.1
by Monty Taylor
Split set_var.* into sys_var.* and set_var.* |
20 |
#ifndef DRIZZLED_SYS_VAR_H
|
21 |
#define DRIZZLED_SYS_VAR_H
|
|
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
22 |
|
656.1.34
by Monty Taylor
Got closer... |
23 |
#include <string> |
1813.2.1
by Monty Taylor
Migrated --basedir to feed a path. |
24 |
#include <boost/filesystem.hpp> |
656.1.34
by Monty Taylor
Got closer... |
25 |
|
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
26 |
#include "drizzled/constrained_value.h" |
1878.3.1
by Monty Taylor
Split set_var.* into sys_var.* and set_var.* |
27 |
#include "drizzled/set_var.h" |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
28 |
#include "drizzled/show_type.h" |
29 |
#include "drizzled/typelib.h" |
|
30 |
#include "drizzled/item_result.h" |
|
31 |
#include "drizzled/base.h" |
|
32 |
#include "drizzled/global_charset_info.h" |
|
33 |
#include "drizzled/lex_string.h" |
|
1122.2.13
by Monty Taylor
Header cleanup. |
34 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
35 |
namespace drizzled |
36 |
{
|
|
1122.2.13
by Monty Taylor
Header cleanup. |
37 |
|
1
by brian
clean slate |
38 |
class sys_var; |
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
39 |
class Time_zone; |
1
by brian
clean slate |
40 |
typedef struct my_locale_st MY_LOCALE; |
41 |
||
1055.2.18
by Jay Pipes
Removes dead variables in set_var.h |
42 |
extern TYPELIB bool_typelib; |
1
by brian
clean slate |
43 |
|
520.1.21
by Brian Aker
THD -> Session rename |
44 |
typedef int (*sys_check_func)(Session *, set_var *); |
45 |
typedef bool (*sys_update_func)(Session *, set_var *); |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
46 |
typedef void (*sys_after_update_func)(Session *, sql_var_t); |
47 |
typedef void (*sys_set_default_func)(Session *, sql_var_t); |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
48 |
typedef unsigned char *(*sys_value_ptr_func)(Session *session); |
1
by brian
clean slate |
49 |
|
1022.2.37
by Monty Taylor
Moved more tolower calls to setup rather than during runtime. |
50 |
static const std::vector<std::string> empty_aliases; |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
51 |
extern struct drizzle_system_variables max_system_variables; |
1241.9.33
by Monty Taylor
Moved most of the global vars to set_var where they belong. |
52 |
extern size_t table_def_size; |
53 |
||
1556.1.1
by Brian Aker
Updates for moving temporary directory. |
54 |
extern std::string drizzle_tmpdir; |
1241.9.33
by Monty Taylor
Moved most of the global vars to set_var where they belong. |
55 |
extern const char *first_keyword; |
56 |
extern const char *in_left_expr_name; |
|
57 |
extern const char *in_additional_cond; |
|
58 |
extern const char *in_having_cond; |
|
59 |
extern char glob_hostname[FN_REFLEN]; |
|
1813.2.1
by Monty Taylor
Migrated --basedir to feed a path. |
60 |
extern boost::filesystem::path basedir; |
1813.2.2
by Monty Taylor
Replaced pid-file with fs::path. |
61 |
extern boost::filesystem::path pid_file; |
1813.2.6
by Monty Taylor
Made secure_file_priv be an fs::path from the beginning. |
62 |
extern boost::filesystem::path secure_file_priv; |
1241.9.33
by Monty Taylor
Moved most of the global vars to set_var where they belong. |
63 |
extern char system_time_zone[30]; |
64 |
extern char *opt_tc_log_file; |
|
65 |
extern uint64_t session_startup_options; |
|
66 |
extern uint32_t global_thread_id; |
|
67 |
extern uint64_t table_cache_size; |
|
1863.1.7
by Monty Taylor
Add a constrained_value class which allows us to set compile-time |
68 |
extern back_log_constraints back_log; |
1241.9.33
by Monty Taylor
Moved most of the global vars to set_var where they belong. |
69 |
extern uint32_t ha_open_options; |
70 |
extern char *drizzled_bind_host; |
|
71 |
extern uint32_t dropping_tables; |
|
72 |
extern bool opt_endinfo; |
|
73 |
extern uint32_t volatile thread_running; |
|
74 |
extern uint32_t volatile global_read_lock; |
|
75 |
extern bool opt_readonly; |
|
76 |
extern char *default_tz_name; |
|
1794.3.2
by Andrew Hutchings
Re-enabled scheduler option. |
77 |
extern const char *opt_scheduler; |
1022.2.37
by Monty Taylor
Moved more tolower calls to setup rather than during runtime. |
78 |
|
1410.3.4
by Djellel E. Difallah
update references to old my_'s |
79 |
uint64_t fix_unsigned(Session *, uint64_t, const struct option *); |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
80 |
|
1878.3.1
by Monty Taylor
Split set_var.* into sys_var.* and set_var.* |
81 |
int sys_var_init(); |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
82 |
|
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
83 |
/**
|
84 |
* A class which represents a variable, either global or
|
|
85 |
* session-local.
|
|
86 |
*/
|
|
1
by brian
clean slate |
87 |
class sys_var |
88 |
{
|
|
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
89 |
protected: |
1857.3.1
by Monty Taylor
Added support for registering regular sys_var instances via module::Context. |
90 |
std::string name; /**< The name of the variable */ |
1976.2.10
by Monty Taylor
Add ability to add a validation function to any sys_var. duh. |
91 |
sys_check_func check_func; |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
92 |
sys_after_update_func after_update; /**< Function pointer triggered after the variable's value is updated */ |
1878.3.1
by Monty Taylor
Split set_var.* into sys_var.* and set_var.* |
93 |
struct option *option_limits; /**< Updated by by sys_var_init() */ |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
94 |
bool m_allow_empty_value; /**< Does variable allow an empty value? */ |
95 |
public: |
|
1976.2.10
by Monty Taylor
Add ability to add a validation function to any sys_var. duh. |
96 |
sys_var(const std::string &name_arg, |
97 |
sys_after_update_func func= NULL, |
|
98 |
sys_check_func check_func_arg= NULL) |
|
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
99 |
:
|
100 |
name(name_arg), |
|
1976.2.10
by Monty Taylor
Add ability to add a validation function to any sys_var. duh. |
101 |
check_func(check_func_arg), |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
102 |
after_update(func), |
1897.4.14
by Monty Taylor
Update to support default values and properly throw warnings on value |
103 |
option_limits(NULL), |
51.1.46
by Jay Pipes
Removed/replaced DBUG symbols and standardized TRUE/FALSE |
104 |
m_allow_empty_value(true) |
1
by brian
clean slate |
105 |
{}
|
106 |
virtual ~sys_var() {} |
|
1022.2.37
by Monty Taylor
Moved more tolower calls to setup rather than during runtime. |
107 |
|
1857.3.1
by Monty Taylor
Added support for registering regular sys_var instances via module::Context. |
108 |
void setName(const std::string &name_in) |
109 |
{
|
|
110 |
name= name_in; |
|
111 |
}
|
|
112 |
||
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
113 |
/**
|
114 |
* Returns the name of the variable.
|
|
115 |
*
|
|
116 |
* @note
|
|
117 |
*
|
|
118 |
* So that we can exist in a Registry. We really need to formalize that
|
|
119 |
*/
|
|
120 |
inline const std::string &getName() const |
|
121 |
{
|
|
122 |
return name; |
|
123 |
}
|
|
124 |
/**
|
|
125 |
* Returns a vector of strings representing aliases
|
|
126 |
* for this variable's name.
|
|
127 |
*/
|
|
128 |
const std::vector<std::string>& getAliases() const |
|
129 |
{
|
|
130 |
return empty_aliases; |
|
131 |
}
|
|
132 |
/**
|
|
133 |
* Returns a pointer to the variable's option limits
|
|
134 |
*/
|
|
1410.3.4
by Djellel E. Difallah
update references to old my_'s |
135 |
inline struct option *getOptionLimits() const |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
136 |
{
|
137 |
return option_limits; |
|
138 |
}
|
|
139 |
/**
|
|
140 |
* Sets the pointer to the variable's option limits
|
|
141 |
*
|
|
1410.3.4
by Djellel E. Difallah
update references to old my_'s |
142 |
* @param Pointer to the option limits option variable
|
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
143 |
*/
|
1410.3.4
by Djellel E. Difallah
update references to old my_'s |
144 |
inline void setOptionLimits(struct option *in_option_limits) |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
145 |
{
|
146 |
option_limits= in_option_limits; |
|
147 |
}
|
|
148 |
/**
|
|
149 |
* Returns the function pointer for after update trigger, or NULL if none.
|
|
150 |
*/
|
|
151 |
inline sys_after_update_func getAfterUpdateTrigger() const |
|
152 |
{
|
|
153 |
return after_update; |
|
154 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
155 |
virtual bool check(Session *session, set_var *var); |
156 |
bool check_enum(Session *session, set_var *var, const TYPELIB *enum_names); |
|
157 |
virtual bool update(Session *session, set_var *var)=0; |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
158 |
virtual void set_default(Session *, sql_var_t) |
77.1.7
by Monty Taylor
Heap builds clean. |
159 |
{}
|
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
160 |
virtual SHOW_TYPE show_type() |
161 |
{
|
|
162 |
return SHOW_UNDEF; |
|
163 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
164 |
virtual unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
165 |
{
|
166 |
return 0; |
|
167 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
168 |
virtual bool check_type(sql_var_t type) |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
169 |
{
|
170 |
return type != OPT_GLOBAL; |
|
171 |
} /* Error if not GLOBAL */ |
|
1
by brian
clean slate |
172 |
virtual bool check_update_type(Item_result type) |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
173 |
{
|
174 |
return type != INT_RESULT; |
|
175 |
} /* Assume INT */ |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
176 |
virtual bool check_default(sql_var_t) |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
177 |
{
|
178 |
return option_limits == 0; |
|
179 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
180 |
Item *item(Session *session, sql_var_t type, const LEX_STRING *base); |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
181 |
virtual bool is_readonly() const |
182 |
{
|
|
183 |
return 0; |
|
184 |
}
|
|
1
by brian
clean slate |
185 |
};
|
186 |
||
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
187 |
/**
|
188 |
* A base class for all variables that require its access to
|
|
189 |
* be guarded with a mutex.
|
|
190 |
*/
|
|
1
by brian
clean slate |
191 |
class sys_var_global: public sys_var |
192 |
{
|
|
193 |
protected: |
|
194 |
pthread_mutex_t *guard; |
|
195 |
public: |
|
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
196 |
sys_var_global(const char *name_arg, |
197 |
sys_after_update_func after_update_arg, |
|
1
by brian
clean slate |
198 |
pthread_mutex_t *guard_arg) |
1055.2.20
by Jay Pipes
Refactors sys_var class -- doxygenates and documents the class members and functions. Protects all member variables and adds public getters/setters. |
199 |
:
|
200 |
sys_var(name_arg, after_update_arg), |
|
201 |
guard(guard_arg) |
|
202 |
{}
|
|
1
by brian
clean slate |
203 |
};
|
204 |
||
520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
205 |
class sys_var_uint32_t_ptr :public sys_var |
206 |
{
|
|
207 |
uint32_t *value; |
|
208 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
209 |
sys_var_uint32_t_ptr(const char *name_arg, |
520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
210 |
uint32_t *value_ptr_arg) |
211 |
:sys_var(name_arg),value(value_ptr_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
212 |
{ } |
213 |
sys_var_uint32_t_ptr(const char *name_arg, |
|
520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
214 |
uint32_t *value_ptr_arg, |
215 |
sys_after_update_func func) |
|
216 |
:sys_var(name_arg,func), value(value_ptr_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
217 |
{ } |
910.4.10
by Stewart Smith
fix system variables for correct endian architectures. |
218 |
bool check(Session *session, set_var *var); |
520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
219 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
220 |
void set_default(Session *session, sql_var_t type); |
910.4.18
by Stewart Smith
fix alignment of variables (incl key cache). fixes SIGBUS on SPARC64 |
221 |
SHOW_TYPE show_type() { return SHOW_INT; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
222 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
223 |
{ return (unsigned char*) value; } |
224 |
};
|
|
225 |
||
1964.2.9
by Monty Taylor
All protocol stuff except for the buffer_length. WTF? |
226 |
class sys_var_uint32_t_ptr_readonly : |
227 |
public sys_var_uint32_t_ptr |
|
228 |
{
|
|
229 |
public: |
|
230 |
sys_var_uint32_t_ptr_readonly(const char *name_arg, |
|
231 |
uint32_t *value_ptr_arg) : |
|
232 |
sys_var_uint32_t_ptr(name_arg, value_ptr_arg) |
|
233 |
{}
|
|
234 |
||
235 |
sys_var_uint32_t_ptr_readonly(const char *name_arg, |
|
236 |
uint32_t *value_ptr_arg, |
|
237 |
sys_after_update_func func) : |
|
238 |
sys_var_uint32_t_ptr(name_arg, value_ptr_arg, func) |
|
239 |
{}
|
|
240 |
||
241 |
bool is_readonly() const |
|
242 |
{
|
|
243 |
return true; |
|
244 |
}
|
|
245 |
};
|
|
246 |
||
520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
247 |
|
151
by Brian Aker
Ulonglong to uint64_t |
248 |
class sys_var_uint64_t_ptr :public sys_var |
1
by brian
clean slate |
249 |
{
|
151
by Brian Aker
Ulonglong to uint64_t |
250 |
uint64_t *value; |
1897.4.14
by Monty Taylor
Update to support default values and properly throw warnings on value |
251 |
const uint64_t default_value; |
252 |
bool have_default_value; |
|
10
by Brian Aker
Start of var cleanup (really.... looking at this code the entire thing needs |
253 |
public: |
1897.4.14
by Monty Taylor
Update to support default values and properly throw warnings on value |
254 |
sys_var_uint64_t_ptr(const char *name_arg, uint64_t *value_ptr_arg) : |
255 |
sys_var(name_arg), |
|
256 |
value(value_ptr_arg), |
|
257 |
default_value(0), |
|
258 |
have_default_value(false) |
|
259 |
{ } |
|
260 |
||
261 |
sys_var_uint64_t_ptr(const char *name_arg, |
|
262 |
uint64_t *value_ptr_arg, |
|
263 |
const uint64_t default_value_in) : |
|
264 |
sys_var(name_arg), |
|
265 |
value(value_ptr_arg), |
|
266 |
default_value(default_value_in), |
|
267 |
have_default_value(true) |
|
268 |
{ } |
|
269 |
||
270 |
sys_var_uint64_t_ptr(const char *name_arg, |
|
271 |
uint64_t *value_ptr_arg, |
|
272 |
sys_after_update_func func) : |
|
273 |
sys_var(name_arg,func), |
|
274 |
value(value_ptr_arg), |
|
275 |
default_value(0), |
|
276 |
have_default_value(false) |
|
277 |
{ } |
|
278 |
||
279 |
sys_var_uint64_t_ptr(const char *name_arg, |
|
280 |
uint64_t *value_ptr_arg, |
|
281 |
sys_after_update_func func, |
|
282 |
const uint64_t default_value_in) : |
|
283 |
sys_var(name_arg,func), |
|
284 |
value(value_ptr_arg), |
|
285 |
default_value(default_value_in), |
|
286 |
have_default_value(true) |
|
287 |
{ } |
|
288 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
289 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
290 |
void set_default(Session *session, sql_var_t type); |
1897.4.14
by Monty Taylor
Update to support default values and properly throw warnings on value |
291 |
virtual bool check_default(sql_var_t) |
292 |
{
|
|
293 |
return (not have_default_value) && option_limits == 0; |
|
294 |
}
|
|
1
by brian
clean slate |
295 |
SHOW_TYPE show_type() { return SHOW_LONGLONG; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
296 |
unsigned char *value_ptr(Session *, sql_var_t, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
297 |
const LEX_STRING *) |
481
by Brian Aker
Remove all of uchar. |
298 |
{ return (unsigned char*) value; } |
1
by brian
clean slate |
299 |
};
|
300 |
||
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
301 |
class sys_var_size_t_ptr :public sys_var |
302 |
{
|
|
303 |
size_t *value; |
|
304 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
305 |
sys_var_size_t_ptr(const char *name_arg, size_t *value_ptr_arg) |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
306 |
:sys_var(name_arg),value(value_ptr_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
307 |
{ } |
308 |
sys_var_size_t_ptr(const char *name_arg, size_t *value_ptr_arg, |
|
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
309 |
sys_after_update_func func) |
310 |
:sys_var(name_arg,func), value(value_ptr_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
311 |
{ } |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
312 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
313 |
void set_default(Session *session, sql_var_t type); |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
314 |
SHOW_TYPE show_type() { return SHOW_SIZE; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
315 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
316 |
{ return (unsigned char*) value; } |
317 |
};
|
|
1
by brian
clean slate |
318 |
|
319 |
class sys_var_bool_ptr :public sys_var |
|
320 |
{
|
|
1964.2.16
by Monty Taylor
took care of innodb SessionVAR usage. |
321 |
bool default_value; |
1
by brian
clean slate |
322 |
public: |
146
by Brian Aker
my_bool cleanup. |
323 |
bool *value; |
1897.4.10
by Monty Taylor
Converted transaction_log. |
324 |
sys_var_bool_ptr(const std::string &name_arg, bool *value_arg, |
325 |
sys_after_update_func func= NULL) : |
|
1964.2.16
by Monty Taylor
took care of innodb SessionVAR usage. |
326 |
sys_var(name_arg, func), default_value(*value_arg), value(value_arg) |
1897.4.10
by Monty Taylor
Converted transaction_log. |
327 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
328 |
bool check(Session *session, set_var *var) |
146
by Brian Aker
my_bool cleanup. |
329 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
330 |
return check_enum(session, var, &bool_typelib); |
146
by Brian Aker
my_bool cleanup. |
331 |
}
|
1964.2.16
by Monty Taylor
took care of innodb SessionVAR usage. |
332 |
virtual bool check_default(sql_var_t) |
333 |
{
|
|
334 |
return false; |
|
335 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
336 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
337 |
void set_default(Session *session, sql_var_t type); |
146
by Brian Aker
my_bool cleanup. |
338 |
SHOW_TYPE show_type() { return SHOW_MY_BOOL; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
339 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
481
by Brian Aker
Remove all of uchar. |
340 |
{ return (unsigned char*) value; } |
644
by Brian Aker
Clean up warnings for Solaris. |
341 |
bool check_update_type(Item_result) |
146
by Brian Aker
my_bool cleanup. |
342 |
{ return 0; } |
343 |
};
|
|
344 |
||
1
by brian
clean slate |
345 |
class sys_var_bool_ptr_readonly :public sys_var_bool_ptr |
346 |
{
|
|
347 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
348 |
sys_var_bool_ptr_readonly(const char *name_arg, |
147
by Brian Aker
More my_bool conversion. This time the set_var class. |
349 |
bool *value_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
350 |
:sys_var_bool_ptr(name_arg, value_arg) |
1
by brian
clean slate |
351 |
{}
|
352 |
bool is_readonly() const { return 1; } |
|
353 |
};
|
|
354 |
||
355 |
||
356 |
class sys_var_str :public sys_var |
|
357 |
{
|
|
358 |
public: |
|
359 |
char *value; // Pointer to allocated string |
|
482
by Brian Aker
Remove uint. |
360 |
uint32_t value_length; |
1
by brian
clean slate |
361 |
sys_update_func update_func; |
362 |
sys_set_default_func set_default_func; |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
363 |
sys_var_str(const char *name_arg, |
1964.1.1
by Monty Taylor
Updated more sys_vars. |
364 |
sys_check_func check_func_arg, |
365 |
sys_update_func update_func_arg, |
|
366 |
sys_set_default_func set_default_func_arg, |
|
1976.2.10
by Monty Taylor
Add ability to add a validation function to any sys_var. duh. |
367 |
char *value_arg) : |
368 |
sys_var(name_arg, NULL, check_func_arg), |
|
369 |
value(value_arg), |
|
370 |
update_func(update_func_arg), |
|
371 |
set_default_func(set_default_func_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
372 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
373 |
bool check(Session *session, set_var *var); |
374 |
bool update(Session *session, set_var *var) |
|
1
by brian
clean slate |
375 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
376 |
return (*update_func)(session, var); |
1
by brian
clean slate |
377 |
}
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
378 |
void set_default(Session *session, sql_var_t type) |
1
by brian
clean slate |
379 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
380 |
(*set_default_func)(session, type); |
1
by brian
clean slate |
381 |
}
|
382 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
383 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
481
by Brian Aker
Remove all of uchar. |
384 |
{ return (unsigned char*) value; } |
1
by brian
clean slate |
385 |
bool check_update_type(Item_result type) |
386 |
{
|
|
387 |
return type != STRING_RESULT; /* Only accept strings */ |
|
388 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
389 |
bool check_default(sql_var_t) |
77.1.7
by Monty Taylor
Heap builds clean. |
390 |
{ return 0; } |
1
by brian
clean slate |
391 |
};
|
392 |
||
393 |
||
1813.2.1
by Monty Taylor
Migrated --basedir to feed a path. |
394 |
class sys_var_fs_path : |
395 |
public sys_var |
|
396 |
{
|
|
397 |
const boost::filesystem::path &value; |
|
398 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
399 |
sys_var_fs_path(const char *name_arg, |
1813.2.1
by Monty Taylor
Migrated --basedir to feed a path. |
400 |
const boost::filesystem::path& value_arg) : |
401 |
sys_var(name_arg), |
|
402 |
value(value_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
403 |
{ } |
1813.2.1
by Monty Taylor
Migrated --basedir to feed a path. |
404 |
|
405 |
inline void set(char *) |
|
406 |
{ } |
|
407 |
||
408 |
bool check(Session *, set_var *) |
|
409 |
{
|
|
410 |
return true; |
|
411 |
}
|
|
412 |
bool update(Session *, set_var *) |
|
413 |
{
|
|
414 |
return true; |
|
415 |
}
|
|
416 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
417 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
|
418 |
{
|
|
419 |
return (unsigned char*)(value.file_string().c_str()); |
|
420 |
}
|
|
421 |
bool check_update_type(Item_result) |
|
422 |
{
|
|
423 |
return true; |
|
424 |
}
|
|
425 |
bool check_default(sql_var_t) { return true; } |
|
426 |
bool is_readonly() const { return true; } |
|
427 |
};
|
|
428 |
||
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
429 |
template<class T> |
430 |
class sys_var_constrained_value : |
|
431 |
public sys_var |
|
432 |
{
|
|
433 |
constrained_value<T> &value; |
|
434 |
T basic_value; |
|
435 |
T default_value; |
|
436 |
public: |
|
437 |
sys_var_constrained_value(const char *name_arg, |
|
438 |
constrained_value<T> &value_arg) : |
|
439 |
sys_var(name_arg), |
|
440 |
value(value_arg), |
|
1964.2.10
by Monty Taylor
Changed show SHOW_INT works ... man, trying to cast things as a method of data storage is lame. |
441 |
default_value(value_arg.get()) |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
442 |
{ } |
443 |
||
444 |
sys_var_constrained_value(const char *name_arg, |
|
445 |
constrained_value<T> &value_arg, |
|
1964.1.1
by Monty Taylor
Updated more sys_vars. |
446 |
sys_after_update_func after_update_func_arg) : |
447 |
sys_var(name_arg, after_update_func_arg), |
|
448 |
value(value_arg), |
|
1964.2.10
by Monty Taylor
Changed show SHOW_INT works ... man, trying to cast things as a method of data storage is lame. |
449 |
default_value(value_arg.get()) |
1964.1.1
by Monty Taylor
Updated more sys_vars. |
450 |
{ } |
451 |
||
1976.2.10
by Monty Taylor
Add ability to add a validation function to any sys_var. duh. |
452 |
sys_var_constrained_value(const char *name_arg, |
453 |
constrained_value<T> &value_arg, |
|
454 |
sys_check_func check_func_arg) : |
|
455 |
sys_var(name_arg, NULL, check_func_arg), |
|
456 |
value(value_arg), |
|
457 |
default_value(value_arg.get()) |
|
458 |
{ } |
|
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
459 |
|
460 |
public: |
|
461 |
bool is_readonly() const |
|
462 |
{
|
|
463 |
return false; |
|
464 |
}
|
|
465 |
||
466 |
SHOW_TYPE show_type() { return SHOW_INT; } |
|
467 |
||
468 |
bool update(Session *, set_var *var) |
|
469 |
{
|
|
2070.2.1
by Monty Taylor
First step in getting that anonymous union out of set_var. |
470 |
value= uint32_t(var->getInteger()); |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
471 |
return false; |
472 |
}
|
|
473 |
||
474 |
bool check_default(sql_var_t) |
|
475 |
{
|
|
1964.2.10
by Monty Taylor
Changed show SHOW_INT works ... man, trying to cast things as a method of data storage is lame. |
476 |
return false; |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
477 |
}
|
478 |
||
479 |
void set_default(Session *, sql_var_t) |
|
480 |
{
|
|
1897.4.17
by Monty Taylor
Reverted a debugging change that snuck in. |
481 |
value= default_value; |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
482 |
}
|
483 |
||
484 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
|
485 |
{
|
|
1964.2.10
by Monty Taylor
Changed show SHOW_INT works ... man, trying to cast things as a method of data storage is lame. |
486 |
basic_value= value.get(); |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
487 |
return (unsigned char*)&basic_value; |
488 |
}
|
|
489 |
};
|
|
490 |
||
491 |
template<> |
|
1863.1.6
by Monty Taylor
Template specialization functions sort of want that inline keyword. |
492 |
inline SHOW_TYPE sys_var_constrained_value<uint64_t>::show_type() |
493 |
{
|
|
494 |
return SHOW_LONGLONG; |
|
495 |
}
|
|
496 |
||
497 |
template<> |
|
498 |
inline SHOW_TYPE sys_var_constrained_value<int64_t>::show_type() |
|
499 |
{
|
|
500 |
return SHOW_LONGLONG; |
|
501 |
}
|
|
502 |
||
503 |
template<> |
|
504 |
inline SHOW_TYPE sys_var_constrained_value<uint32_t>::show_type() |
|
505 |
{
|
|
1964.2.10
by Monty Taylor
Changed show SHOW_INT works ... man, trying to cast things as a method of data storage is lame. |
506 |
return SHOW_INT; |
1863.1.6
by Monty Taylor
Template specialization functions sort of want that inline keyword. |
507 |
}
|
508 |
||
509 |
template<> |
|
510 |
inline SHOW_TYPE sys_var_constrained_value<int32_t>::show_type() |
|
511 |
{
|
|
512 |
return SHOW_LONG; |
|
513 |
}
|
|
514 |
||
515 |
template<> |
|
516 |
inline bool sys_var_constrained_value<uint64_t>::update(Session *, set_var *var) |
|
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
517 |
{
|
2070.2.1
by Monty Taylor
First step in getting that anonymous union out of set_var. |
518 |
value= var->getInteger(); |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
519 |
return false; |
520 |
}
|
|
521 |
||
522 |
template<> |
|
1863.1.6
by Monty Taylor
Template specialization functions sort of want that inline keyword. |
523 |
inline bool sys_var_constrained_value<uint32_t>::update(Session *, set_var *var) |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
524 |
{
|
2070.2.1
by Monty Taylor
First step in getting that anonymous union out of set_var. |
525 |
value= uint32_t(var->getInteger()); |
1863.1.4
by Monty Taylor
Made basic type for set_var_constrained_value. |
526 |
return false; |
527 |
}
|
|
528 |
||
1897.4.1
by Monty Taylor
Added readonly constrained_value class. |
529 |
template<class T> |
530 |
class sys_var_constrained_value_readonly : |
|
531 |
public sys_var_constrained_value<T> |
|
532 |
{
|
|
533 |
public: |
|
534 |
sys_var_constrained_value_readonly(const char *name_arg, |
|
535 |
constrained_value<T> &value_arg) : |
|
536 |
sys_var_constrained_value<T>(name_arg, value_arg) |
|
537 |
{ } |
|
538 |
||
539 |
sys_var_constrained_value_readonly(const char *name_arg, |
|
540 |
constrained_value<T> &value_arg, |
|
541 |
T default_value_arg) : |
|
542 |
sys_var_constrained_value<T>(name_arg, value_arg, default_value_arg) |
|
543 |
{ } |
|
544 |
||
545 |
public: |
|
546 |
bool is_readonly() const |
|
547 |
{
|
|
548 |
return true; |
|
549 |
}
|
|
550 |
};
|
|
1863.1.11
by Monty Taylor
Put in template specializations to make ICC happy. |
551 |
|
1945.1.2
by Monty Taylor
Add better support in constrained_check for min/max support. Add string ref class. |
552 |
class sys_var_std_string : |
553 |
public sys_var |
|
554 |
{
|
|
555 |
std::string &value; |
|
556 |
sys_check_func check_func; |
|
557 |
sys_update_func update_func; |
|
558 |
sys_set_default_func set_default_func; |
|
559 |
public: |
|
560 |
sys_var_std_string(const std::string &name_arg, |
|
561 |
std::string &value_arg, |
|
562 |
sys_check_func check_func_arg= NULL, |
|
563 |
sys_update_func update_func_arg= NULL) : |
|
564 |
sys_var(name_arg), |
|
565 |
value(value_arg), |
|
566 |
check_func(check_func_arg), |
|
567 |
update_func(update_func_arg) |
|
568 |
{ } |
|
569 |
||
570 |
inline void set(char *val_in) |
|
571 |
{
|
|
572 |
value= val_in; |
|
573 |
}
|
|
574 |
||
575 |
void set_check_func(sys_check_func check_func_arg= NULL) |
|
576 |
{
|
|
577 |
check_func= check_func_arg; |
|
578 |
}
|
|
579 |
||
580 |
void set_update_func(sys_update_func update_func_arg= NULL) |
|
581 |
{
|
|
582 |
update_func= update_func_arg; |
|
583 |
}
|
|
584 |
||
585 |
bool check(Session *session, set_var *var); |
|
586 |
||
587 |
bool update(Session *session, set_var *var) |
|
588 |
{
|
|
589 |
if (update_func != NULL) |
|
590 |
{
|
|
591 |
return (*update_func)(session, var); |
|
592 |
}
|
|
593 |
return false; |
|
594 |
}
|
|
595 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
596 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
|
597 |
{
|
|
598 |
return (unsigned char*)(value.c_str()); |
|
599 |
}
|
|
600 |
bool check_update_type(Item_result type) |
|
601 |
{
|
|
602 |
return type != STRING_RESULT; /* Only accept strings */ |
|
603 |
}
|
|
604 |
bool check_default(sql_var_t) |
|
605 |
{ return true; } |
|
606 |
bool is_readonly() const { return false; } |
|
607 |
};
|
|
608 |
||
1857.4.1
by Monty Taylor
Added string sys_var type. |
609 |
class sys_var_const_string : |
610 |
public sys_var |
|
611 |
{
|
|
612 |
const std::string &value; |
|
613 |
public: |
|
614 |
sys_var_const_string(const char *name_arg, |
|
615 |
const std::string& value_arg) : |
|
616 |
sys_var(name_arg), |
|
617 |
value(value_arg) |
|
618 |
{ } |
|
619 |
||
620 |
inline void set(char *) |
|
621 |
{ } |
|
622 |
||
623 |
bool check(Session *, set_var *) |
|
624 |
{
|
|
625 |
return true; |
|
626 |
}
|
|
627 |
bool update(Session *, set_var *) |
|
628 |
{
|
|
629 |
return true; |
|
630 |
}
|
|
631 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
632 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
|
633 |
{
|
|
634 |
return (unsigned char*)(value.c_str()); |
|
635 |
}
|
|
636 |
bool check_update_type(Item_result) |
|
637 |
{
|
|
638 |
return true; |
|
639 |
}
|
|
640 |
bool check_default(sql_var_t) { return true; } |
|
641 |
bool is_readonly() const { return true; } |
|
642 |
};
|
|
643 |
||
644 |
class sys_var_const_string_val : |
|
645 |
public sys_var |
|
646 |
{
|
|
647 |
const std::string value; |
|
648 |
public: |
|
649 |
sys_var_const_string_val(const char *name_arg, |
|
650 |
const std::string& value_arg) : |
|
651 |
sys_var(name_arg), |
|
652 |
value(value_arg) |
|
653 |
{ } |
|
654 |
||
655 |
inline void set(char *) |
|
656 |
{ } |
|
657 |
||
658 |
bool check(Session *, set_var *) |
|
659 |
{
|
|
660 |
return true; |
|
661 |
}
|
|
662 |
bool update(Session *, set_var *) |
|
663 |
{
|
|
664 |
return true; |
|
665 |
}
|
|
666 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
667 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
|
668 |
{
|
|
669 |
return (unsigned char*)(value.c_str()); |
|
670 |
}
|
|
671 |
bool check_update_type(Item_result) |
|
672 |
{
|
|
673 |
return true; |
|
674 |
}
|
|
675 |
bool check_default(sql_var_t) { return true; } |
|
676 |
bool is_readonly() const { return true; } |
|
677 |
};
|
|
678 |
||
1
by brian
clean slate |
679 |
class sys_var_const_str :public sys_var |
680 |
{
|
|
681 |
char *value; // Pointer to const value |
|
10
by Brian Aker
Start of var cleanup (really.... looking at this code the entire thing needs |
682 |
public: |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
683 |
sys_var_const_str(const char *name_arg, |
1
by brian
clean slate |
684 |
const char *value_arg) |
685 |
:sys_var(name_arg), value((char*) value_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
686 |
{ } |
10
by Brian Aker
Start of var cleanup (really.... looking at this code the entire thing needs |
687 |
inline void set (char *new_value) |
688 |
{
|
|
689 |
value= new_value; |
|
690 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
691 |
bool check(Session *, set_var *) |
1
by brian
clean slate |
692 |
{
|
693 |
return 1; |
|
694 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
695 |
bool update(Session *, set_var *) |
1
by brian
clean slate |
696 |
{
|
697 |
return 1; |
|
698 |
}
|
|
699 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
700 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
1
by brian
clean slate |
701 |
{
|
481
by Brian Aker
Remove all of uchar. |
702 |
return (unsigned char*) value; |
1
by brian
clean slate |
703 |
}
|
644
by Brian Aker
Clean up warnings for Solaris. |
704 |
bool check_update_type(Item_result) |
1
by brian
clean slate |
705 |
{
|
706 |
return 1; |
|
707 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
708 |
bool check_default(sql_var_t) |
77.1.7
by Monty Taylor
Heap builds clean. |
709 |
{ return 1; } |
1
by brian
clean slate |
710 |
bool is_readonly() const { return 1; } |
711 |
};
|
|
712 |
||
713 |
||
714 |
class sys_var_const_str_ptr :public sys_var |
|
715 |
{
|
|
716 |
char **value; // Pointer to const value |
|
10
by Brian Aker
Start of var cleanup (really.... looking at this code the entire thing needs |
717 |
public: |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
718 |
sys_var_const_str_ptr(const char *name_arg, char **value_arg) |
1
by brian
clean slate |
719 |
:sys_var(name_arg),value(value_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
720 |
{ } |
644
by Brian Aker
Clean up warnings for Solaris. |
721 |
bool check(Session *, set_var *) |
1
by brian
clean slate |
722 |
{
|
723 |
return 1; |
|
724 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
725 |
bool update(Session *, set_var *) |
1
by brian
clean slate |
726 |
{
|
727 |
return 1; |
|
728 |
}
|
|
729 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
730 |
unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *) |
1
by brian
clean slate |
731 |
{
|
481
by Brian Aker
Remove all of uchar. |
732 |
return (unsigned char*) *value; |
1
by brian
clean slate |
733 |
}
|
644
by Brian Aker
Clean up warnings for Solaris. |
734 |
bool check_update_type(Item_result) |
1
by brian
clean slate |
735 |
{
|
736 |
return 1; |
|
737 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
738 |
bool check_default(sql_var_t) |
77.1.7
by Monty Taylor
Heap builds clean. |
739 |
{ return 1; } |
740 |
bool is_readonly(void) const { return 1; } |
|
1
by brian
clean slate |
741 |
};
|
742 |
||
743 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
744 |
class sys_var_session :public sys_var |
1
by brian
clean slate |
745 |
{
|
746 |
public: |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
747 |
sys_var_session(const char *name_arg, |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
748 |
sys_after_update_func func= NULL) |
749 |
:sys_var(name_arg, func) |
|
1
by brian
clean slate |
750 |
{}
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
751 |
bool check_type(sql_var_t) |
77.1.7
by Monty Taylor
Heap builds clean. |
752 |
{ return 0; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
753 |
bool check_default(sql_var_t type) |
1
by brian
clean slate |
754 |
{
|
755 |
return type == OPT_GLOBAL && !option_limits; |
|
756 |
}
|
|
757 |
};
|
|
758 |
||
615
by Brian Aker
Added 32bit system variable support |
759 |
class sys_var_session_uint32_t :public sys_var_session |
760 |
{
|
|
761 |
sys_check_func check_func; |
|
762 |
public: |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
763 |
uint32_t drizzle_system_variables::*offset; |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
764 |
sys_var_session_uint32_t(const char *name_arg, |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
765 |
uint32_t drizzle_system_variables::*offset_arg, |
615
by Brian Aker
Added 32bit system variable support |
766 |
sys_check_func c_func= NULL, |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
767 |
sys_after_update_func au_func= NULL) |
768 |
:sys_var_session(name_arg, au_func), check_func(c_func), |
|
615
by Brian Aker
Added 32bit system variable support |
769 |
offset(offset_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
770 |
{ } |
615
by Brian Aker
Added 32bit system variable support |
771 |
bool check(Session *session, set_var *var); |
772 |
bool update(Session *session, set_var *var); |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
773 |
void set_default(Session *session, sql_var_t type); |
910.4.18
by Stewart Smith
fix alignment of variables (incl key cache). fixes SIGBUS on SPARC64 |
774 |
SHOW_TYPE show_type() { return SHOW_INT; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
775 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
776 |
const LEX_STRING *base); |
615
by Brian Aker
Added 32bit system variable support |
777 |
};
|
778 |
||
1
by brian
clean slate |
779 |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
780 |
class sys_var_session_ha_rows :public sys_var_session |
1
by brian
clean slate |
781 |
{
|
782 |
public: |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
783 |
ha_rows drizzle_system_variables::*offset; |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
784 |
sys_var_session_ha_rows(const char *name_arg, |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
785 |
ha_rows drizzle_system_variables::*offset_arg) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
786 |
:sys_var_session(name_arg), offset(offset_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
787 |
{ } |
788 |
sys_var_session_ha_rows(const char *name_arg, |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
789 |
ha_rows drizzle_system_variables::*offset_arg, |
1
by brian
clean slate |
790 |
sys_after_update_func func) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
791 |
:sys_var_session(name_arg,func), offset(offset_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
792 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
793 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
794 |
void set_default(Session *session, sql_var_t type); |
1
by brian
clean slate |
795 |
SHOW_TYPE show_type() { return SHOW_HA_ROWS; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
796 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
797 |
const LEX_STRING *base); |
1
by brian
clean slate |
798 |
};
|
799 |
||
800 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
801 |
class sys_var_session_uint64_t :public sys_var_session |
1
by brian
clean slate |
802 |
{
|
555
by Monty
Fixed 32-bit issues. |
803 |
sys_check_func check_func; |
1
by brian
clean slate |
804 |
public: |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
805 |
uint64_t drizzle_system_variables::*offset; |
1
by brian
clean slate |
806 |
bool only_global; |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
807 |
sys_var_session_uint64_t( |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
808 |
const char *name_arg, |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
809 |
uint64_t drizzle_system_variables::*offset_arg, |
555
by Monty
Fixed 32-bit issues. |
810 |
sys_after_update_func au_func= NULL, |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
811 |
sys_check_func c_func= NULL) |
812 |
:sys_var_session(name_arg, au_func), |
|
617
by Brian Aker
ulong fixes |
813 |
check_func(c_func), |
814 |
offset(offset_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
815 |
{ } |
816 |
sys_var_session_uint64_t(const char *name_arg, |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
817 |
uint64_t drizzle_system_variables::*offset_arg, |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
818 |
sys_after_update_func func, |
617
by Brian Aker
ulong fixes |
819 |
bool only_global_arg, |
820 |
sys_check_func cfunc= NULL) |
|
555
by Monty
Fixed 32-bit issues. |
821 |
:sys_var_session(name_arg, func), |
822 |
check_func(cfunc), |
|
823 |
offset(offset_arg), |
|
1
by brian
clean slate |
824 |
only_global(only_global_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
825 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
826 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
827 |
void set_default(Session *session, sql_var_t type); |
1
by brian
clean slate |
828 |
SHOW_TYPE show_type() { return SHOW_LONGLONG; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
829 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
830 |
const LEX_STRING *base); |
520.1.22
by Brian Aker
Second pass of thd cleanup |
831 |
bool check(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
832 |
bool check_default(sql_var_t type) |
1
by brian
clean slate |
833 |
{
|
834 |
return type == OPT_GLOBAL && !option_limits; |
|
835 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
836 |
bool check_type(sql_var_t type) |
1
by brian
clean slate |
837 |
{
|
838 |
return (only_global && type != OPT_GLOBAL); |
|
839 |
}
|
|
840 |
};
|
|
841 |
||
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
842 |
class sys_var_session_size_t :public sys_var_session |
843 |
{
|
|
844 |
sys_check_func check_func; |
|
845 |
public: |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
846 |
size_t drizzle_system_variables::*offset; |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
847 |
bool only_global; |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
848 |
sys_var_session_size_t(const char *name_arg, |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
849 |
size_t drizzle_system_variables::*offset_arg, |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
850 |
sys_after_update_func au_func= NULL, |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
851 |
sys_check_func c_func= NULL) |
852 |
:sys_var_session(name_arg, au_func), |
|
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
853 |
check_func(c_func), |
854 |
offset(offset_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
855 |
{ } |
856 |
sys_var_session_size_t(const char *name_arg, |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
857 |
size_t drizzle_system_variables::*offset_arg, |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
858 |
sys_after_update_func func, |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
859 |
bool only_global_arg, |
860 |
sys_check_func cfunc= NULL) |
|
861 |
:sys_var_session(name_arg, func), |
|
862 |
check_func(cfunc), |
|
863 |
offset(offset_arg), |
|
864 |
only_global(only_global_arg) |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
865 |
{ } |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
866 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
867 |
void set_default(Session *session, sql_var_t type); |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
868 |
SHOW_TYPE show_type() { return SHOW_SIZE; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
869 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
870 |
const LEX_STRING *base); |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
871 |
bool check(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
872 |
bool check_default(sql_var_t type) |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
873 |
{
|
874 |
return type == OPT_GLOBAL && !option_limits; |
|
875 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
876 |
bool check_type(sql_var_t type) |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
877 |
{
|
878 |
return (only_global && type != OPT_GLOBAL); |
|
879 |
}
|
|
880 |
};
|
|
881 |
||
1
by brian
clean slate |
882 |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
883 |
class sys_var_session_bool :public sys_var_session |
1
by brian
clean slate |
884 |
{
|
885 |
public: |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
886 |
bool drizzle_system_variables::*offset; |
887 |
sys_var_session_bool(const char *name_arg, bool drizzle_system_variables::*offset_arg) |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
888 |
:sys_var_session(name_arg), offset(offset_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
889 |
{ } |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
890 |
sys_var_session_bool(const char *name_arg, bool drizzle_system_variables::*offset_arg, |
1
by brian
clean slate |
891 |
sys_after_update_func func) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
892 |
:sys_var_session(name_arg,func), offset(offset_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
893 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
894 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
895 |
void set_default(Session *session, sql_var_t type); |
1
by brian
clean slate |
896 |
SHOW_TYPE show_type() { return SHOW_MY_BOOL; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
897 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
898 |
const LEX_STRING *base); |
520.1.22
by Brian Aker
Second pass of thd cleanup |
899 |
bool check(Session *session, set_var *var) |
1
by brian
clean slate |
900 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
901 |
return check_enum(session, var, &bool_typelib); |
1
by brian
clean slate |
902 |
}
|
644
by Brian Aker
Clean up warnings for Solaris. |
903 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
904 |
{ return 0; } |
1
by brian
clean slate |
905 |
};
|
906 |
||
907 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
908 |
class sys_var_session_enum :public sys_var_session |
1
by brian
clean slate |
909 |
{
|
910 |
protected: |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
911 |
uint32_t drizzle_system_variables::*offset; |
1
by brian
clean slate |
912 |
TYPELIB *enum_names; |
913 |
sys_check_func check_func; |
|
914 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
915 |
sys_var_session_enum(const char *name_arg, |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
916 |
uint32_t drizzle_system_variables::*offset_arg, TYPELIB *typelib, |
1
by brian
clean slate |
917 |
sys_after_update_func func= NULL, |
801.1.1
by Brian Aker
Solaris build error fix. |
918 |
sys_check_func check_f= NULL) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
919 |
:sys_var_session(name_arg, func), offset(offset_arg), |
801.1.1
by Brian Aker
Solaris build error fix. |
920 |
enum_names(typelib), check_func(check_f) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
921 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
922 |
bool check(Session *session, set_var *var) |
1
by brian
clean slate |
923 |
{
|
924 |
int ret= 0; |
|
925 |
if (check_func) |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
926 |
ret= (*check_func)(session, var); |
927 |
return ret ? ret : check_enum(session, var, enum_names); |
|
1
by brian
clean slate |
928 |
}
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
929 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
930 |
void set_default(Session *session, sql_var_t type); |
1
by brian
clean slate |
931 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
932 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
933 |
const LEX_STRING *base); |
644
by Brian Aker
Clean up warnings for Solaris. |
934 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
935 |
{ return 0; } |
1
by brian
clean slate |
936 |
};
|
937 |
||
938 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
939 |
class sys_var_session_storage_engine :public sys_var_session |
1
by brian
clean slate |
940 |
{
|
941 |
protected: |
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
942 |
plugin::StorageEngine *drizzle_system_variables::*offset; |
1
by brian
clean slate |
943 |
public: |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
944 |
sys_var_session_storage_engine(const char *name_arg, |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
945 |
plugin::StorageEngine *drizzle_system_variables::*offset_arg) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
946 |
:sys_var_session(name_arg), offset(offset_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
947 |
{ } |
1
by brian
clean slate |
948 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
949 |
bool check_update_type(Item_result type) |
|
950 |
{
|
|
951 |
return type != STRING_RESULT; /* Only accept strings */ |
|
952 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
953 |
void set_default(Session *session, sql_var_t type); |
520.1.22
by Brian Aker
Second pass of thd cleanup |
954 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
955 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
956 |
const LEX_STRING *base); |
1
by brian
clean slate |
957 |
};
|
958 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
959 |
class sys_var_session_bit :public sys_var_session |
1
by brian
clean slate |
960 |
{
|
961 |
sys_check_func check_func; |
|
962 |
sys_update_func update_func; |
|
963 |
public: |
|
151
by Brian Aker
Ulonglong to uint64_t |
964 |
uint64_t bit_flag; |
1
by brian
clean slate |
965 |
bool reverse; |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
966 |
sys_var_session_bit(const char *name_arg, |
1
by brian
clean slate |
967 |
sys_check_func c_func, sys_update_func u_func, |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
968 |
uint64_t bit, bool reverse_arg=0) |
969 |
:sys_var_session(name_arg, NULL), check_func(c_func), |
|
1
by brian
clean slate |
970 |
update_func(u_func), bit_flag(bit), reverse(reverse_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
971 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
972 |
bool check(Session *session, set_var *var); |
973 |
bool update(Session *session, set_var *var); |
|
644
by Brian Aker
Clean up warnings for Solaris. |
974 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
975 |
{ return 0; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
976 |
bool check_type(sql_var_t type) { return type == OPT_GLOBAL; } |
1
by brian
clean slate |
977 |
SHOW_TYPE show_type() { return SHOW_MY_BOOL; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
978 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
979 |
const LEX_STRING *base); |
1
by brian
clean slate |
980 |
};
|
981 |
||
982 |
/* some variables that require special handling */
|
|
983 |
||
984 |
class sys_var_timestamp :public sys_var |
|
985 |
{
|
|
986 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
987 |
sys_var_timestamp(const char *name_arg) |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
988 |
:sys_var(name_arg, NULL) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
989 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
990 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
991 |
void set_default(Session *session, sql_var_t type); |
992 |
bool check_type(sql_var_t type) { return type == OPT_GLOBAL; } |
|
993 |
bool check_default(sql_var_t) |
|
77.1.7
by Monty Taylor
Heap builds clean. |
994 |
{ return 0; } |
995 |
SHOW_TYPE show_type(void) { return SHOW_LONG; } |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
996 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
997 |
const LEX_STRING *base); |
1
by brian
clean slate |
998 |
};
|
999 |
||
1000 |
||
1001 |
class sys_var_last_insert_id :public sys_var |
|
1002 |
{
|
|
1003 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1004 |
sys_var_last_insert_id(const char *name_arg) |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
1005 |
:sys_var(name_arg, NULL) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1006 |
{ } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1007 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1008 |
bool check_type(sql_var_t type) { return type == OPT_GLOBAL; } |
1
by brian
clean slate |
1009 |
SHOW_TYPE show_type() { return SHOW_LONGLONG; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1010 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
1011 |
const LEX_STRING *base); |
1
by brian
clean slate |
1012 |
};
|
1013 |
||
1014 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1015 |
class sys_var_collation :public sys_var_session |
1
by brian
clean slate |
1016 |
{
|
1017 |
public: |
|
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
1018 |
sys_var_collation(const char *name_arg) |
1019 |
:sys_var_session(name_arg, NULL) |
|
744
by Brian Aker
Removing dead code around one shot. |
1020 |
{ } |
1
by brian
clean slate |
1021 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
1022 |
bool check_update_type(Item_result type) |
|
1023 |
{
|
|
1024 |
return ((type != STRING_RESULT) && (type != INT_RESULT)); |
|
1025 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
1026 |
bool check_default(sql_var_t) { return 0; } |
1027 |
virtual void set_default(Session *session, sql_var_t type)= 0; |
|
1
by brian
clean slate |
1028 |
};
|
1029 |
||
1030 |
class sys_var_collation_sv :public sys_var_collation |
|
1031 |
{
|
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
1032 |
const CHARSET_INFO *drizzle_system_variables::*offset; |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
1033 |
const CHARSET_INFO **global_default; |
1
by brian
clean slate |
1034 |
public: |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1035 |
sys_var_collation_sv(const char *name_arg, |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
1036 |
const CHARSET_INFO *drizzle_system_variables::*offset_arg, |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
1037 |
const CHARSET_INFO **global_default_arg) |
1038 |
:sys_var_collation(name_arg), |
|
1
by brian
clean slate |
1039 |
offset(offset_arg), global_default(global_default_arg) |
1040 |
{
|
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1041 |
|
1
by brian
clean slate |
1042 |
}
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1043 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1044 |
void set_default(Session *session, sql_var_t type); |
1045 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
|
779.3.10
by Monty Taylor
Turned on -Wshadow. |
1046 |
const LEX_STRING *base); |
1
by brian
clean slate |
1047 |
};
|
1048 |
||
1049 |
/* Variable that you can only read from */
|
|
1050 |
||
1051 |
class sys_var_readonly: public sys_var |
|
1052 |
{
|
|
1053 |
public: |
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
1054 |
sql_var_t var_type; |
1
by brian
clean slate |
1055 |
SHOW_TYPE show_type_value; |
1056 |
sys_value_ptr_func value_ptr_func; |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1057 |
sys_var_readonly(const char *name_arg, sql_var_t type, |
1
by brian
clean slate |
1058 |
SHOW_TYPE show_type_arg, |
1059 |
sys_value_ptr_func value_ptr_func_arg) |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
1060 |
:sys_var(name_arg), var_type(type), |
1
by brian
clean slate |
1061 |
show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1062 |
{ } |
644
by Brian Aker
Clean up warnings for Solaris. |
1063 |
bool update(Session *, set_var *) |
77.1.7
by Monty Taylor
Heap builds clean. |
1064 |
{ return 1; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1065 |
bool check_default(sql_var_t) |
77.1.7
by Monty Taylor
Heap builds clean. |
1066 |
{ return 1; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1067 |
bool check_type(sql_var_t type) { return type != var_type; } |
644
by Brian Aker
Clean up warnings for Solaris. |
1068 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
1069 |
{ return 1; } |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1070 |
unsigned char *value_ptr(Session *session, sql_var_t, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
1071 |
const LEX_STRING *) |
1
by brian
clean slate |
1072 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1073 |
return (*value_ptr_func)(session); |
1
by brian
clean slate |
1074 |
}
|
77.1.7
by Monty Taylor
Heap builds clean. |
1075 |
SHOW_TYPE show_type(void) { return show_type_value; } |
1076 |
bool is_readonly(void) const { return 1; } |
|
1
by brian
clean slate |
1077 |
};
|
1078 |
||
1079 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1080 |
class sys_var_session_time_zone :public sys_var_session |
1
by brian
clean slate |
1081 |
{
|
1082 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1083 |
sys_var_session_time_zone(const char *name_arg) |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
1084 |
:sys_var_session(name_arg, NULL) |
1
by brian
clean slate |
1085 |
{
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1086 |
|
1
by brian
clean slate |
1087 |
}
|
1088 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
1089 |
bool check_update_type(Item_result type) |
|
1090 |
{
|
|
1091 |
return type != STRING_RESULT; /* Only accept strings */ |
|
1092 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
1093 |
bool check_default(sql_var_t) |
77.1.7
by Monty Taylor
Heap builds clean. |
1094 |
{ return 0; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1095 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1096 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
1097 |
const LEX_STRING *base); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1098 |
virtual void set_default(Session *session, sql_var_t type); |
1
by brian
clean slate |
1099 |
};
|
1100 |
||
1101 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1102 |
class sys_var_microseconds :public sys_var_session |
1
by brian
clean slate |
1103 |
{
|
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
1104 |
uint64_t drizzle_system_variables::*offset; |
1
by brian
clean slate |
1105 |
public: |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1106 |
sys_var_microseconds(const char *name_arg, |
1878.3.2
by Monty Taylor
Split out show_type into its own header and made sys_var work through |
1107 |
uint64_t drizzle_system_variables::*offset_arg): |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1108 |
sys_var_session(name_arg), offset(offset_arg) |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1109 |
{ } |
644
by Brian Aker
Clean up warnings for Solaris. |
1110 |
bool check(Session *, set_var *) {return 0;} |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1111 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1112 |
void set_default(Session *session, sql_var_t type); |
1
by brian
clean slate |
1113 |
SHOW_TYPE show_type() { return SHOW_DOUBLE; } |
1114 |
bool check_update_type(Item_result type) |
|
1115 |
{
|
|
1116 |
return (type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT); |
|
1117 |
}
|
|
1118 |
};
|
|
1119 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1120 |
class sys_var_session_lc_time_names :public sys_var_session |
1
by brian
clean slate |
1121 |
{
|
1122 |
public: |
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1123 |
sys_var_session_lc_time_names(const char *name_arg) |
1018
by Brian Aker
Remove "BINLOG" from variables (we don't need this for our replication). |
1124 |
: sys_var_session(name_arg, NULL) |
1
by brian
clean slate |
1125 |
{
|
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1126 |
|
1
by brian
clean slate |
1127 |
}
|
1128 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
1129 |
bool check_update_type(Item_result type) |
|
1130 |
{
|
|
1131 |
return ((type != STRING_RESULT) && (type != INT_RESULT)); |
|
1132 |
}
|
|
1273.13.24
by Brian Aker
Updating style, simplified code. |
1133 |
bool check_default(sql_var_t) |
77.1.7
by Monty Taylor
Heap builds clean. |
1134 |
{ return 0; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1135 |
bool update(Session *session, set_var *var); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1136 |
unsigned char *value_ptr(Session *session, sql_var_t type, |
779.3.10
by Monty Taylor
Turned on -Wshadow. |
1137 |
const LEX_STRING *base); |
1273.13.24
by Brian Aker
Updating style, simplified code. |
1138 |
virtual void set_default(Session *session, sql_var_t type); |
1
by brian
clean slate |
1139 |
};
|
1140 |
||
1141 |
||
1142 |
||
1143 |
/* For sql_yacc */
|
|
1144 |
struct sys_var_with_base |
|
1145 |
{
|
|
1146 |
sys_var *var; |
|
1147 |
LEX_STRING base_name; |
|
1148 |
};
|
|
1149 |
||
1150 |
/*
|
|
1151 |
Prototypes for helper functions
|
|
1152 |
*/
|
|
1153 |
||
1813.2.8
by Monty Taylor
Removed the fixed_vars. |
1154 |
drizzle_show_var* enumerate_sys_vars(Session *session); |
1851.1.1
by Monty Taylor
Removed sys_var_chain. |
1155 |
void add_sys_var_to_list(sys_var *var, struct option *long_options); |
1156 |
void add_sys_var_to_list(sys_var *var); |
|
2040.6.3
by Monty Taylor
Removed unused no_error bool param. |
1157 |
sys_var *find_sys_var(const std::string &name); |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1158 |
extern sys_var_session_time_zone sys_time_zone; |
1159 |
extern sys_var_session_bit sys_autocommit; |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
1160 |
const CHARSET_INFO *get_old_charset_by_name(const char *old_name); |
1
by brian
clean slate |
1161 |
|
1162 |
extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path; |
|
1163 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
1164 |
} /* namespace drizzled */ |
1165 |
||
1878.3.1
by Monty Taylor
Split set_var.* into sys_var.* and set_var.* |
1166 |
#endif /* DRIZZLED_SYS_VAR_H */ |