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