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 |
*
|
|
4 |
* Copyright (C) 2008 Sun Microsystems
|
|
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 |
|
575.1.6
by Monty Taylor
Cleaned up some headers for PCH. |
20 |
#ifndef DRIZZLED_ITEM_SET_H
|
21 |
#define DRIZZLED_ITEM_SET_H
|
|
22 |
||
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. |
23 |
#include <drizzled/functions/func.h> |
24 |
#include <drizzled/functions/set_user_var.h> |
|
25 |
||
656.1.34
by Monty Taylor
Got closer... |
26 |
#include <string> |
27 |
||
1
by brian
clean slate |
28 |
/* Classes to support the SET command */
|
29 |
||
30 |
||
31 |
/****************************************************************************
|
|
32 |
Variables that are changable runtime are declared using the
|
|
33 |
following classes
|
|
34 |
****************************************************************************/
|
|
35 |
||
36 |
class sys_var; |
|
37 |
class set_var; |
|
38 |
class sys_var_pluginvar; /* opaque */ |
|
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 system_variables SV; |
41 |
typedef struct my_locale_st MY_LOCALE; |
|
42 |
||
43 |
extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib, |
|
617
by Brian Aker
ulong fixes |
44 |
optimizer_switch_typelib, slave_exec_mode_typelib; |
1
by brian
clean slate |
45 |
|
520.1.21
by Brian Aker
THD -> Session rename |
46 |
typedef int (*sys_check_func)(Session *, set_var *); |
47 |
typedef bool (*sys_update_func)(Session *, set_var *); |
|
48 |
typedef void (*sys_after_update_func)(Session *,enum_var_type); |
|
49 |
typedef void (*sys_set_default_func)(Session *, enum_var_type); |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
50 |
typedef unsigned char *(*sys_value_ptr_func)(Session *session); |
1
by brian
clean slate |
51 |
|
52 |
struct sys_var_chain |
|
53 |
{
|
|
54 |
sys_var *first; |
|
55 |
sys_var *last; |
|
56 |
};
|
|
57 |
||
58 |
class sys_var |
|
59 |
{
|
|
60 |
public: |
|
61 |
||
62 |
/**
|
|
63 |
Enumeration type to indicate for a system variable whether it will be written to the binlog or not.
|
|
64 |
*/
|
|
65 |
enum Binlog_status_enum |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
66 |
{
|
1
by brian
clean slate |
67 |
/* The variable value is not in the binlog. */
|
68 |
NOT_IN_BINLOG, |
|
69 |
/* The value of the @@session variable is in the binlog. */
|
|
70 |
SESSION_VARIABLE_IN_BINLOG
|
|
71 |
/*
|
|
72 |
Currently, no @@global variable is ever in the binlog, so we
|
|
73 |
don't need an enumeration value for that.
|
|
74 |
*/
|
|
75 |
};
|
|
76 |
||
77 |
sys_var *next; |
|
78 |
struct my_option *option_limits; /* Updated by by set_var_init() */ |
|
482
by Brian Aker
Remove uint. |
79 |
uint32_t name_length; /* Updated by by set_var_init() */ |
1
by brian
clean slate |
80 |
const char *name; |
81 |
||
82 |
sys_after_update_func after_update; |
|
83 |
bool no_support_one_shot; |
|
84 |
sys_var(const char *name_arg, sys_after_update_func func= NULL, |
|
85 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
|
86 |
:name(name_arg), after_update(func), no_support_one_shot(1), |
|
87 |
binlog_status(binlog_status_arg), |
|
51.1.46
by Jay Pipes
Removed/replaced DBUG symbols and standardized TRUE/FALSE |
88 |
m_allow_empty_value(true) |
1
by brian
clean slate |
89 |
{}
|
90 |
virtual ~sys_var() {} |
|
91 |
void chain_sys_var(sys_var_chain *chain_arg) |
|
92 |
{
|
|
93 |
if (chain_arg->last) |
|
94 |
chain_arg->last->next= this; |
|
95 |
else
|
|
96 |
chain_arg->first= this; |
|
97 |
chain_arg->last= this; |
|
98 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
99 |
virtual bool check(Session *session, set_var *var); |
100 |
bool check_enum(Session *session, set_var *var, const TYPELIB *enum_names); |
|
101 |
bool check_set(Session *session, set_var *var, TYPELIB *enum_names); |
|
102 |
virtual bool update(Session *session, set_var *var)=0; |
|
644
by Brian Aker
Clean up warnings for Solaris. |
103 |
virtual void set_default(Session *, enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
104 |
{}
|
1
by brian
clean slate |
105 |
virtual SHOW_TYPE show_type() { return SHOW_UNDEF; } |
644
by Brian Aker
Clean up warnings for Solaris. |
106 |
virtual unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
1
by brian
clean slate |
107 |
{ return 0; } |
108 |
virtual bool check_type(enum_var_type type) |
|
109 |
{ return type != OPT_GLOBAL; } /* Error if not GLOBAL */ |
|
110 |
virtual bool check_update_type(Item_result type) |
|
111 |
{ return type != INT_RESULT; } /* Assume INT */ |
|
644
by Brian Aker
Clean up warnings for Solaris. |
112 |
virtual bool check_default(enum_var_type) |
1
by brian
clean slate |
113 |
{ return option_limits == 0; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
114 |
Item *item(Session *session, enum_var_type type, LEX_STRING *base); |
1
by brian
clean slate |
115 |
virtual bool is_struct() { return 0; } |
116 |
virtual bool is_readonly() const { return 0; } |
|
117 |
virtual sys_var_pluginvar *cast_pluginvar() { return 0; } |
|
118 |
||
119 |
protected: |
|
120 |
void set_allow_empty_value(bool allow_empty_value) |
|
121 |
{
|
|
122 |
m_allow_empty_value= allow_empty_value; |
|
123 |
}
|
|
124 |
||
125 |
private: |
|
126 |
const Binlog_status_enum binlog_status; |
|
127 |
||
128 |
bool m_allow_empty_value; |
|
129 |
};
|
|
130 |
||
131 |
||
132 |
/*
|
|
133 |
A base class for all variables that require its access to
|
|
134 |
be guarded with a mutex.
|
|
135 |
*/
|
|
136 |
||
137 |
class sys_var_global: public sys_var |
|
138 |
{
|
|
139 |
protected: |
|
140 |
pthread_mutex_t *guard; |
|
141 |
public: |
|
142 |
sys_var_global(const char *name_arg, sys_after_update_func after_update_arg, |
|
143 |
pthread_mutex_t *guard_arg) |
|
144 |
:sys_var(name_arg, after_update_arg), guard(guard_arg) {} |
|
145 |
};
|
|
146 |
||
147 |
||
148 |
/*
|
|
622
by Brian Aker
More ulong work. |
149 |
A global-only uint64_t variable that requires its access to be
|
1
by brian
clean slate |
150 |
protected with a mutex.
|
151 |
*/
|
|
152 |
||
153 |
class sys_var_long_ptr_global: public sys_var_global |
|
154 |
{
|
|
622
by Brian Aker
More ulong work. |
155 |
uint64_t *value; |
1
by brian
clean slate |
156 |
public: |
157 |
sys_var_long_ptr_global(sys_var_chain *chain, const char *name_arg, |
|
622
by Brian Aker
More ulong work. |
158 |
uint64_t *value_ptr_arg, |
1
by brian
clean slate |
159 |
pthread_mutex_t *guard_arg, |
160 |
sys_after_update_func after_update_arg= NULL) |
|
161 |
:sys_var_global(name_arg, after_update_arg, guard_arg), |
|
162 |
value(value_ptr_arg) |
|
163 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
164 |
bool check(Session *session, set_var *var); |
165 |
bool update(Session *session, set_var *var); |
|
166 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
167 |
SHOW_TYPE show_type() { return SHOW_LONG; } |
644
by Brian Aker
Clean up warnings for Solaris. |
168 |
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
481
by Brian Aker
Remove all of uchar. |
169 |
{ return (unsigned char*) value; } |
1
by brian
clean slate |
170 |
};
|
171 |
||
172 |
||
173 |
/*
|
|
622
by Brian Aker
More ulong work. |
174 |
A global uint64_t variable that is protected by LOCK_global_system_variables
|
1
by brian
clean slate |
175 |
*/
|
176 |
||
177 |
class sys_var_long_ptr :public sys_var_long_ptr_global |
|
178 |
{
|
|
179 |
public: |
|
622
by Brian Aker
More ulong work. |
180 |
sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, uint64_t *value_ptr, |
1
by brian
clean slate |
181 |
sys_after_update_func after_update_arg= NULL); |
182 |
};
|
|
183 |
||
184 |
||
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. |
185 |
class sys_var_uint32_t_ptr :public sys_var |
186 |
{
|
|
187 |
uint32_t *value; |
|
188 |
public: |
|
189 |
sys_var_uint32_t_ptr(sys_var_chain *chain, const char *name_arg, |
|
190 |
uint32_t *value_ptr_arg) |
|
191 |
:sys_var(name_arg),value(value_ptr_arg) |
|
192 |
{ chain_sys_var(chain); } |
|
193 |
sys_var_uint32_t_ptr(sys_var_chain *chain, const char *name_arg, |
|
194 |
uint32_t *value_ptr_arg, |
|
195 |
sys_after_update_func func) |
|
196 |
:sys_var(name_arg,func), value(value_ptr_arg) |
|
197 |
{ chain_sys_var(chain); } |
|
198 |
bool update(Session *session, set_var *var); |
|
199 |
void set_default(Session *session, enum_var_type type); |
|
200 |
SHOW_TYPE show_type() { return SHOW_LONG; } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
201 |
unsigned char *value_ptr(Session *, enum_var_type, 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. |
202 |
{ return (unsigned char*) value; } |
203 |
};
|
|
204 |
||
205 |
||
151
by Brian Aker
Ulonglong to uint64_t |
206 |
class sys_var_uint64_t_ptr :public sys_var |
1
by brian
clean slate |
207 |
{
|
151
by Brian Aker
Ulonglong to uint64_t |
208 |
uint64_t *value; |
10
by Brian Aker
Start of var cleanup (really.... looking at this code the entire thing needs |
209 |
public: |
151
by Brian Aker
Ulonglong to uint64_t |
210 |
sys_var_uint64_t_ptr(sys_var_chain *chain, const char *name_arg, uint64_t *value_ptr_arg) |
1
by brian
clean slate |
211 |
:sys_var(name_arg),value(value_ptr_arg) |
212 |
{ chain_sys_var(chain); } |
|
151
by Brian Aker
Ulonglong to uint64_t |
213 |
sys_var_uint64_t_ptr(sys_var_chain *chain, const char *name_arg, uint64_t *value_ptr_arg, |
1
by brian
clean slate |
214 |
sys_after_update_func func) |
215 |
:sys_var(name_arg,func), value(value_ptr_arg) |
|
216 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
217 |
bool update(Session *session, set_var *var); |
218 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
219 |
SHOW_TYPE show_type() { return SHOW_LONGLONG; } |
644
by Brian Aker
Clean up warnings for Solaris. |
220 |
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
481
by Brian Aker
Remove all of uchar. |
221 |
{ return (unsigned char*) value; } |
1
by brian
clean slate |
222 |
};
|
223 |
||
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
224 |
class sys_var_size_t_ptr :public sys_var |
225 |
{
|
|
226 |
size_t *value; |
|
227 |
public: |
|
228 |
sys_var_size_t_ptr(sys_var_chain *chain, const char *name_arg, size_t *value_ptr_arg) |
|
229 |
:sys_var(name_arg),value(value_ptr_arg) |
|
230 |
{ chain_sys_var(chain); } |
|
231 |
sys_var_size_t_ptr(sys_var_chain *chain, const char *name_arg, size_t *value_ptr_arg, |
|
232 |
sys_after_update_func func) |
|
233 |
:sys_var(name_arg,func), value(value_ptr_arg) |
|
234 |
{ chain_sys_var(chain); } |
|
235 |
bool update(Session *session, set_var *var); |
|
236 |
void set_default(Session *session, enum_var_type type); |
|
237 |
SHOW_TYPE show_type() { return SHOW_SIZE; } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
238 |
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
239 |
{ return (unsigned char*) value; } |
240 |
};
|
|
1
by brian
clean slate |
241 |
|
242 |
class sys_var_bool_ptr :public sys_var |
|
243 |
{
|
|
244 |
public: |
|
146
by Brian Aker
my_bool cleanup. |
245 |
bool *value; |
147
by Brian Aker
More my_bool conversion. This time the set_var class. |
246 |
sys_var_bool_ptr(sys_var_chain *chain, const char *name_arg, bool *value_arg) |
146
by Brian Aker
my_bool cleanup. |
247 |
:sys_var(name_arg),value(value_arg) |
248 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
249 |
bool check(Session *session, set_var *var) |
146
by Brian Aker
my_bool cleanup. |
250 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
251 |
return check_enum(session, var, &bool_typelib); |
146
by Brian Aker
my_bool cleanup. |
252 |
}
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
253 |
bool update(Session *session, set_var *var); |
254 |
void set_default(Session *session, enum_var_type type); |
|
146
by Brian Aker
my_bool cleanup. |
255 |
SHOW_TYPE show_type() { return SHOW_MY_BOOL; } |
644
by Brian Aker
Clean up warnings for Solaris. |
256 |
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
481
by Brian Aker
Remove all of uchar. |
257 |
{ return (unsigned char*) value; } |
644
by Brian Aker
Clean up warnings for Solaris. |
258 |
bool check_update_type(Item_result) |
146
by Brian Aker
my_bool cleanup. |
259 |
{ return 0; } |
260 |
};
|
|
261 |
||
1
by brian
clean slate |
262 |
class sys_var_bool_ptr_readonly :public sys_var_bool_ptr |
263 |
{
|
|
264 |
public: |
|
265 |
sys_var_bool_ptr_readonly(sys_var_chain *chain, const char *name_arg, |
|
147
by Brian Aker
More my_bool conversion. This time the set_var class. |
266 |
bool *value_arg) |
1
by brian
clean slate |
267 |
:sys_var_bool_ptr(chain, name_arg, value_arg) |
268 |
{}
|
|
269 |
bool is_readonly() const { return 1; } |
|
270 |
};
|
|
271 |
||
272 |
||
273 |
class sys_var_str :public sys_var |
|
274 |
{
|
|
275 |
public: |
|
276 |
char *value; // Pointer to allocated string |
|
482
by Brian Aker
Remove uint. |
277 |
uint32_t value_length; |
1
by brian
clean slate |
278 |
sys_check_func check_func; |
279 |
sys_update_func update_func; |
|
280 |
sys_set_default_func set_default_func; |
|
281 |
sys_var_str(sys_var_chain *chain, const char *name_arg, |
|
282 |
sys_check_func check_func_arg, |
|
283 |
sys_update_func update_func_arg, |
|
284 |
sys_set_default_func set_default_func_arg, |
|
285 |
char *value_arg) |
|
286 |
:sys_var(name_arg), value(value_arg), check_func(check_func_arg), |
|
287 |
update_func(update_func_arg),set_default_func(set_default_func_arg) |
|
288 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
289 |
bool check(Session *session, set_var *var); |
290 |
bool update(Session *session, set_var *var) |
|
1
by brian
clean slate |
291 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
292 |
return (*update_func)(session, var); |
1
by brian
clean slate |
293 |
}
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
294 |
void set_default(Session *session, enum_var_type type) |
1
by brian
clean slate |
295 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
296 |
(*set_default_func)(session, type); |
1
by brian
clean slate |
297 |
}
|
298 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
299 |
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
481
by Brian Aker
Remove all of uchar. |
300 |
{ return (unsigned char*) value; } |
1
by brian
clean slate |
301 |
bool check_update_type(Item_result type) |
302 |
{
|
|
303 |
return type != STRING_RESULT; /* Only accept strings */ |
|
304 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
305 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
306 |
{ return 0; } |
1
by brian
clean slate |
307 |
};
|
308 |
||
309 |
||
310 |
class sys_var_const_str :public sys_var |
|
311 |
{
|
|
312 |
char *value; // Pointer to const value |
|
10
by Brian Aker
Start of var cleanup (really.... looking at this code the entire thing needs |
313 |
public: |
1
by brian
clean slate |
314 |
sys_var_const_str(sys_var_chain *chain, const char *name_arg, |
315 |
const char *value_arg) |
|
316 |
:sys_var(name_arg), value((char*) value_arg) |
|
317 |
{ chain_sys_var(chain); } |
|
10
by Brian Aker
Start of var cleanup (really.... looking at this code the entire thing needs |
318 |
inline void set (char *new_value) |
319 |
{
|
|
320 |
value= new_value; |
|
321 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
322 |
bool check(Session *, set_var *) |
1
by brian
clean slate |
323 |
{
|
324 |
return 1; |
|
325 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
326 |
bool update(Session *, set_var *) |
1
by brian
clean slate |
327 |
{
|
328 |
return 1; |
|
329 |
}
|
|
330 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
331 |
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
1
by brian
clean slate |
332 |
{
|
481
by Brian Aker
Remove all of uchar. |
333 |
return (unsigned char*) value; |
1
by brian
clean slate |
334 |
}
|
644
by Brian Aker
Clean up warnings for Solaris. |
335 |
bool check_update_type(Item_result) |
1
by brian
clean slate |
336 |
{
|
337 |
return 1; |
|
338 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
339 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
340 |
{ return 1; } |
1
by brian
clean slate |
341 |
bool is_readonly() const { return 1; } |
342 |
};
|
|
343 |
||
344 |
||
345 |
class sys_var_const_str_ptr :public sys_var |
|
346 |
{
|
|
347 |
char **value; // Pointer to const value |
|
10
by Brian Aker
Start of var cleanup (really.... looking at this code the entire thing needs |
348 |
public: |
1
by brian
clean slate |
349 |
sys_var_const_str_ptr(sys_var_chain *chain, const char *name_arg, char **value_arg) |
350 |
:sys_var(name_arg),value(value_arg) |
|
351 |
{ chain_sys_var(chain); } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
352 |
bool check(Session *, set_var *) |
1
by brian
clean slate |
353 |
{
|
354 |
return 1; |
|
355 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
356 |
bool update(Session *, set_var *) |
1
by brian
clean slate |
357 |
{
|
358 |
return 1; |
|
359 |
}
|
|
360 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
361 |
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
1
by brian
clean slate |
362 |
{
|
481
by Brian Aker
Remove all of uchar. |
363 |
return (unsigned char*) *value; |
1
by brian
clean slate |
364 |
}
|
644
by Brian Aker
Clean up warnings for Solaris. |
365 |
bool check_update_type(Item_result) |
1
by brian
clean slate |
366 |
{
|
367 |
return 1; |
|
368 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
369 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
370 |
{ return 1; } |
371 |
bool is_readonly(void) const { return 1; } |
|
1
by brian
clean slate |
372 |
};
|
373 |
||
374 |
||
375 |
class sys_var_enum :public sys_var |
|
376 |
{
|
|
482
by Brian Aker
Remove uint. |
377 |
uint32_t *value; |
1
by brian
clean slate |
378 |
TYPELIB *enum_names; |
379 |
public: |
|
482
by Brian Aker
Remove uint. |
380 |
sys_var_enum(sys_var_chain *chain, const char *name_arg, uint32_t *value_arg, |
1
by brian
clean slate |
381 |
TYPELIB *typelib, sys_after_update_func func) |
382 |
:sys_var(name_arg,func), value(value_arg), enum_names(typelib) |
|
383 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
384 |
bool check(Session *session, set_var *var) |
1
by brian
clean slate |
385 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
386 |
return check_enum(session, var, enum_names); |
1
by brian
clean slate |
387 |
}
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
388 |
bool update(Session *session, set_var *var); |
1
by brian
clean slate |
389 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
390 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
644
by Brian Aker
Clean up warnings for Solaris. |
391 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
392 |
{ return 0; } |
1
by brian
clean slate |
393 |
};
|
394 |
||
395 |
||
396 |
class sys_var_enum_const :public sys_var |
|
397 |
{
|
|
621
by Brian Aker
ulong fixes |
398 |
uint32_t SV::*offset; |
1
by brian
clean slate |
399 |
TYPELIB *enum_names; |
400 |
public: |
|
621
by Brian Aker
ulong fixes |
401 |
sys_var_enum_const(sys_var_chain *chain, const char *name_arg, uint32_t SV::*offset_arg, |
1
by brian
clean slate |
402 |
TYPELIB *typelib, sys_after_update_func func) |
403 |
:sys_var(name_arg,func), offset(offset_arg), enum_names(typelib) |
|
404 |
{ chain_sys_var(chain); } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
405 |
bool check(Session *, set_var *) |
77.1.7
by Monty Taylor
Heap builds clean. |
406 |
{ return 1; } |
644
by Brian Aker
Clean up warnings for Solaris. |
407 |
bool update(Session *, set_var *) |
77.1.7
by Monty Taylor
Heap builds clean. |
408 |
{ return 1; } |
1
by brian
clean slate |
409 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
644
by Brian Aker
Clean up warnings for Solaris. |
410 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
411 |
{ return 1; } |
1
by brian
clean slate |
412 |
bool is_readonly() const { return 1; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
413 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
1
by brian
clean slate |
414 |
};
|
415 |
||
416 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
417 |
class sys_var_session :public sys_var |
1
by brian
clean slate |
418 |
{
|
419 |
public: |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
420 |
sys_var_session(const char *name_arg, |
1
by brian
clean slate |
421 |
sys_after_update_func func= NULL, |
422 |
Binlog_status_enum binlog_status= NOT_IN_BINLOG) |
|
423 |
:sys_var(name_arg, func, binlog_status) |
|
424 |
{}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
425 |
bool check_type(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
426 |
{ return 0; } |
1
by brian
clean slate |
427 |
bool check_default(enum_var_type type) |
428 |
{
|
|
429 |
return type == OPT_GLOBAL && !option_limits; |
|
430 |
}
|
|
431 |
};
|
|
432 |
||
615
by Brian Aker
Added 32bit system variable support |
433 |
class sys_var_session_uint32_t :public sys_var_session |
434 |
{
|
|
435 |
sys_check_func check_func; |
|
436 |
public: |
|
437 |
uint32_t SV::*offset; |
|
438 |
sys_var_session_uint32_t(sys_var_chain *chain, const char *name_arg, |
|
439 |
uint32_t SV::*offset_arg, |
|
440 |
sys_check_func c_func= NULL, |
|
441 |
sys_after_update_func au_func= NULL, |
|
442 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
|
443 |
:sys_var_session(name_arg, au_func, binlog_status_arg), check_func(c_func), |
|
444 |
offset(offset_arg) |
|
445 |
{ chain_sys_var(chain); } |
|
446 |
bool check(Session *session, set_var *var); |
|
447 |
bool update(Session *session, set_var *var); |
|
448 |
void set_default(Session *session, enum_var_type type); |
|
449 |
SHOW_TYPE show_type() { return SHOW_LONG; } |
|
450 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
451 |
};
|
|
452 |
||
1
by brian
clean slate |
453 |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
454 |
class sys_var_session_ha_rows :public sys_var_session |
1
by brian
clean slate |
455 |
{
|
456 |
public: |
|
457 |
ha_rows SV::*offset; |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
458 |
sys_var_session_ha_rows(sys_var_chain *chain, const char *name_arg, |
1
by brian
clean slate |
459 |
ha_rows SV::*offset_arg) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
460 |
:sys_var_session(name_arg), offset(offset_arg) |
1
by brian
clean slate |
461 |
{ chain_sys_var(chain); } |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
462 |
sys_var_session_ha_rows(sys_var_chain *chain, const char *name_arg, |
1
by brian
clean slate |
463 |
ha_rows SV::*offset_arg, |
464 |
sys_after_update_func func) |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
465 |
:sys_var_session(name_arg,func), offset(offset_arg) |
1
by brian
clean slate |
466 |
{ chain_sys_var(chain); } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
467 |
bool update(Session *session, set_var *var); |
468 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
469 |
SHOW_TYPE show_type() { return SHOW_HA_ROWS; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
470 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
1
by brian
clean slate |
471 |
};
|
472 |
||
473 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
474 |
class sys_var_session_uint64_t :public sys_var_session |
1
by brian
clean slate |
475 |
{
|
555
by Monty
Fixed 32-bit issues. |
476 |
sys_check_func check_func; |
1
by brian
clean slate |
477 |
public: |
151
by Brian Aker
Ulonglong to uint64_t |
478 |
uint64_t SV::*offset; |
1
by brian
clean slate |
479 |
bool only_global; |
555
by Monty
Fixed 32-bit issues. |
480 |
sys_var_session_uint64_t(sys_var_chain *chain, const char *name_arg, |
481 |
uint64_t SV::*offset_arg, |
|
482 |
sys_after_update_func au_func= NULL, |
|
483 |
sys_check_func c_func= NULL, |
|
484 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
|
617
by Brian Aker
ulong fixes |
485 |
:sys_var_session(name_arg, au_func, binlog_status_arg), |
486 |
check_func(c_func), |
|
487 |
offset(offset_arg) |
|
488 |
{ chain_sys_var(chain); } |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
489 |
sys_var_session_uint64_t(sys_var_chain *chain, |
490 |
const char *name_arg, |
|
491 |
uint64_t SV::*offset_arg, |
|
492 |
sys_after_update_func func, |
|
617
by Brian Aker
ulong fixes |
493 |
bool only_global_arg, |
494 |
sys_check_func cfunc= NULL) |
|
555
by Monty
Fixed 32-bit issues. |
495 |
:sys_var_session(name_arg, func), |
496 |
check_func(cfunc), |
|
497 |
offset(offset_arg), |
|
1
by brian
clean slate |
498 |
only_global(only_global_arg) |
499 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
500 |
bool update(Session *session, set_var *var); |
501 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
502 |
SHOW_TYPE show_type() { return SHOW_LONGLONG; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
503 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
504 |
bool check(Session *session, set_var *var); |
|
1
by brian
clean slate |
505 |
bool check_default(enum_var_type type) |
506 |
{
|
|
507 |
return type == OPT_GLOBAL && !option_limits; |
|
508 |
}
|
|
509 |
bool check_type(enum_var_type type) |
|
510 |
{
|
|
511 |
return (only_global && type != OPT_GLOBAL); |
|
512 |
}
|
|
513 |
};
|
|
514 |
||
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
515 |
class sys_var_session_size_t :public sys_var_session |
516 |
{
|
|
517 |
sys_check_func check_func; |
|
518 |
public: |
|
519 |
size_t SV::*offset; |
|
520 |
bool only_global; |
|
521 |
sys_var_session_size_t(sys_var_chain *chain, const char *name_arg, |
|
522 |
size_t SV::*offset_arg, |
|
523 |
sys_after_update_func au_func= NULL, |
|
524 |
sys_check_func c_func= NULL, |
|
525 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
|
526 |
:sys_var_session(name_arg, au_func, binlog_status_arg), |
|
527 |
check_func(c_func), |
|
528 |
offset(offset_arg) |
|
529 |
{ chain_sys_var(chain); } |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
530 |
sys_var_session_size_t(sys_var_chain *chain, |
531 |
const char *name_arg, |
|
532 |
size_t SV::*offset_arg, |
|
533 |
sys_after_update_func func, |
|
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
534 |
bool only_global_arg, |
535 |
sys_check_func cfunc= NULL) |
|
536 |
:sys_var_session(name_arg, func), |
|
537 |
check_func(cfunc), |
|
538 |
offset(offset_arg), |
|
539 |
only_global(only_global_arg) |
|
540 |
{ chain_sys_var(chain); } |
|
541 |
bool update(Session *session, set_var *var); |
|
542 |
void set_default(Session *session, enum_var_type type); |
|
543 |
SHOW_TYPE show_type() { return SHOW_SIZE; } |
|
544 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
545 |
bool check(Session *session, set_var *var); |
|
546 |
bool check_default(enum_var_type type) |
|
547 |
{
|
|
548 |
return type == OPT_GLOBAL && !option_limits; |
|
549 |
}
|
|
550 |
bool check_type(enum_var_type type) |
|
551 |
{
|
|
552 |
return (only_global && type != OPT_GLOBAL); |
|
553 |
}
|
|
554 |
};
|
|
555 |
||
1
by brian
clean slate |
556 |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
557 |
class sys_var_session_bool :public sys_var_session |
1
by brian
clean slate |
558 |
{
|
559 |
public: |
|
200
by Brian Aker
my_bool from handler and set_var |
560 |
bool SV::*offset; |
520.1.22
by Brian Aker
Second pass of thd cleanup |
561 |
sys_var_session_bool(sys_var_chain *chain, const char *name_arg, bool SV::*offset_arg) |
562 |
:sys_var_session(name_arg), offset(offset_arg) |
|
1
by brian
clean slate |
563 |
{ chain_sys_var(chain); } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
564 |
sys_var_session_bool(sys_var_chain *chain, const char *name_arg, bool SV::*offset_arg, |
1
by brian
clean slate |
565 |
sys_after_update_func func) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
566 |
:sys_var_session(name_arg,func), offset(offset_arg) |
1
by brian
clean slate |
567 |
{ chain_sys_var(chain); } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
568 |
bool update(Session *session, set_var *var); |
569 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
570 |
SHOW_TYPE show_type() { return SHOW_MY_BOOL; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
571 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
572 |
bool check(Session *session, set_var *var) |
|
1
by brian
clean slate |
573 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
574 |
return check_enum(session, var, &bool_typelib); |
1
by brian
clean slate |
575 |
}
|
644
by Brian Aker
Clean up warnings for Solaris. |
576 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
577 |
{ return 0; } |
1
by brian
clean slate |
578 |
};
|
579 |
||
580 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
581 |
class sys_var_session_enum :public sys_var_session |
1
by brian
clean slate |
582 |
{
|
583 |
protected: |
|
617
by Brian Aker
ulong fixes |
584 |
uint32_t SV::*offset; |
1
by brian
clean slate |
585 |
TYPELIB *enum_names; |
586 |
sys_check_func check_func; |
|
587 |
public: |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
588 |
sys_var_session_enum(sys_var_chain *chain, const char *name_arg, |
617
by Brian Aker
ulong fixes |
589 |
uint32_t SV::*offset_arg, TYPELIB *typelib, |
1
by brian
clean slate |
590 |
sys_after_update_func func= NULL, |
591 |
sys_check_func check= NULL) |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
592 |
:sys_var_session(name_arg, func), offset(offset_arg), |
1
by brian
clean slate |
593 |
enum_names(typelib), check_func(check) |
594 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
595 |
bool check(Session *session, set_var *var) |
1
by brian
clean slate |
596 |
{
|
597 |
int ret= 0; |
|
598 |
if (check_func) |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
599 |
ret= (*check_func)(session, var); |
600 |
return ret ? ret : check_enum(session, var, enum_names); |
|
1
by brian
clean slate |
601 |
}
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
602 |
bool update(Session *session, set_var *var); |
603 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
604 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
605 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
644
by Brian Aker
Clean up warnings for Solaris. |
606 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
607 |
{ return 0; } |
1
by brian
clean slate |
608 |
};
|
609 |
||
610 |
||
611 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
612 |
class sys_var_session_optimizer_switch :public sys_var_session_enum |
1
by brian
clean slate |
613 |
{
|
614 |
public: |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
615 |
sys_var_session_optimizer_switch(sys_var_chain *chain, const char *name_arg, |
617
by Brian Aker
ulong fixes |
616 |
uint32_t SV::*offset_arg) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
617 |
:sys_var_session_enum(chain, name_arg, offset_arg, &optimizer_switch_typelib) |
1
by brian
clean slate |
618 |
{}
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
619 |
bool check(Session *session, set_var *var) |
1
by brian
clean slate |
620 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
621 |
return check_set(session, var, enum_names); |
1
by brian
clean slate |
622 |
}
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
623 |
void set_default(Session *session, enum_var_type type); |
624 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
617
by Brian Aker
ulong fixes |
625 |
static bool symbolic_mode_representation(Session *session, uint32_t sql_mode, |
1
by brian
clean slate |
626 |
LEX_STRING *rep); |
627 |
};
|
|
628 |
||
629 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
630 |
class sys_var_session_storage_engine :public sys_var_session |
1
by brian
clean slate |
631 |
{
|
632 |
protected: |
|
633 |
plugin_ref SV::*offset; |
|
634 |
public: |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
635 |
sys_var_session_storage_engine(sys_var_chain *chain, const char *name_arg, |
1
by brian
clean slate |
636 |
plugin_ref SV::*offset_arg) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
637 |
:sys_var_session(name_arg), offset(offset_arg) |
1
by brian
clean slate |
638 |
{ chain_sys_var(chain); } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
639 |
bool check(Session *session, set_var *var); |
1
by brian
clean slate |
640 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
641 |
bool check_update_type(Item_result type) |
|
642 |
{
|
|
643 |
return type != STRING_RESULT; /* Only accept strings */ |
|
644 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
645 |
void set_default(Session *session, enum_var_type type); |
646 |
bool update(Session *session, set_var *var); |
|
647 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
1
by brian
clean slate |
648 |
};
|
649 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
650 |
class sys_var_session_bit :public sys_var_session |
1
by brian
clean slate |
651 |
{
|
652 |
sys_check_func check_func; |
|
653 |
sys_update_func update_func; |
|
654 |
public: |
|
151
by Brian Aker
Ulonglong to uint64_t |
655 |
uint64_t bit_flag; |
1
by brian
clean slate |
656 |
bool reverse; |
520.1.22
by Brian Aker
Second pass of thd cleanup |
657 |
sys_var_session_bit(sys_var_chain *chain, const char *name_arg, |
1
by brian
clean slate |
658 |
sys_check_func c_func, sys_update_func u_func, |
151
by Brian Aker
Ulonglong to uint64_t |
659 |
uint64_t bit, bool reverse_arg=0, |
1
by brian
clean slate |
660 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
661 |
:sys_var_session(name_arg, NULL, binlog_status_arg), check_func(c_func), |
1
by brian
clean slate |
662 |
update_func(u_func), bit_flag(bit), reverse(reverse_arg) |
663 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
664 |
bool check(Session *session, set_var *var); |
665 |
bool update(Session *session, set_var *var); |
|
644
by Brian Aker
Clean up warnings for Solaris. |
666 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
667 |
{ return 0; } |
1
by brian
clean slate |
668 |
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } |
669 |
SHOW_TYPE show_type() { return SHOW_MY_BOOL; } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
670 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
1
by brian
clean slate |
671 |
};
|
672 |
||
673 |
/* some variables that require special handling */
|
|
674 |
||
675 |
class sys_var_timestamp :public sys_var |
|
676 |
{
|
|
677 |
public: |
|
678 |
sys_var_timestamp(sys_var_chain *chain, const char *name_arg, |
|
679 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
|
680 |
:sys_var(name_arg, NULL, binlog_status_arg) |
|
681 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
682 |
bool update(Session *session, set_var *var); |
683 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
684 |
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } |
644
by Brian Aker
Clean up warnings for Solaris. |
685 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
686 |
{ return 0; } |
687 |
SHOW_TYPE show_type(void) { return SHOW_LONG; } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
688 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
1
by brian
clean slate |
689 |
};
|
690 |
||
691 |
||
692 |
class sys_var_last_insert_id :public sys_var |
|
693 |
{
|
|
694 |
public: |
|
695 |
sys_var_last_insert_id(sys_var_chain *chain, const char *name_arg, |
|
696 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
|
697 |
:sys_var(name_arg, NULL, binlog_status_arg) |
|
698 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
699 |
bool update(Session *session, set_var *var); |
1
by brian
clean slate |
700 |
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } |
701 |
SHOW_TYPE show_type() { return SHOW_LONGLONG; } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
702 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
1
by brian
clean slate |
703 |
};
|
704 |
||
705 |
||
706 |
class sys_var_insert_id :public sys_var |
|
707 |
{
|
|
708 |
public: |
|
709 |
sys_var_insert_id(sys_var_chain *chain, const char *name_arg) |
|
710 |
:sys_var(name_arg) |
|
711 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
712 |
bool update(Session *session, set_var *var); |
1
by brian
clean slate |
713 |
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } |
714 |
SHOW_TYPE show_type() { return SHOW_LONGLONG; } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
715 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
1
by brian
clean slate |
716 |
};
|
717 |
||
718 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
719 |
class sys_var_collation :public sys_var_session |
1
by brian
clean slate |
720 |
{
|
721 |
public: |
|
722 |
sys_var_collation(const char *name_arg, |
|
723 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
724 |
:sys_var_session(name_arg, NULL, binlog_status_arg) |
1
by brian
clean slate |
725 |
{
|
726 |
no_support_one_shot= 0; |
|
727 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
728 |
bool check(Session *session, set_var *var); |
1
by brian
clean slate |
729 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
730 |
bool check_update_type(Item_result type) |
|
731 |
{
|
|
732 |
return ((type != STRING_RESULT) && (type != INT_RESULT)); |
|
733 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
734 |
bool check_default(enum_var_type) { return 0; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
735 |
virtual void set_default(Session *session, enum_var_type type)= 0; |
1
by brian
clean slate |
736 |
};
|
737 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
738 |
class sys_var_character_set :public sys_var_session |
1
by brian
clean slate |
739 |
{
|
740 |
public: |
|
741 |
bool nullable; |
|
742 |
sys_var_character_set(const char *name_arg, bool is_nullable= 0, |
|
743 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
744 |
:sys_var_session(name_arg, NULL, binlog_status_arg), nullable(is_nullable) |
1
by brian
clean slate |
745 |
{
|
746 |
/*
|
|
747 |
In fact only almost all variables derived from sys_var_character_set
|
|
748 |
support ONE_SHOT; character_set_results doesn't. But that's good enough.
|
|
749 |
*/
|
|
750 |
no_support_one_shot= 0; |
|
751 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
752 |
bool check(Session *session, set_var *var); |
1
by brian
clean slate |
753 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
754 |
bool check_update_type(Item_result type) |
|
755 |
{
|
|
756 |
return ((type != STRING_RESULT) && (type != INT_RESULT)); |
|
757 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
758 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
759 |
{ return 0; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
760 |
bool update(Session *session, set_var *var); |
761 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
762 |
virtual void set_default(Session *session, enum_var_type type)= 0; |
|
763 |
virtual const CHARSET_INFO **ci_ptr(Session *session, enum_var_type type)= 0; |
|
1
by brian
clean slate |
764 |
};
|
765 |
||
766 |
class sys_var_collation_sv :public sys_var_collation |
|
767 |
{
|
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
768 |
const CHARSET_INFO *SV::*offset; |
769 |
const CHARSET_INFO **global_default; |
|
1
by brian
clean slate |
770 |
public: |
771 |
sys_var_collation_sv(sys_var_chain *chain, const char *name_arg, |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
772 |
const CHARSET_INFO *SV::*offset_arg, |
773 |
const CHARSET_INFO **global_default_arg, |
|
1
by brian
clean slate |
774 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
775 |
:sys_var_collation(name_arg, binlog_status_arg), |
|
776 |
offset(offset_arg), global_default(global_default_arg) |
|
777 |
{
|
|
778 |
chain_sys_var(chain); |
|
779 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
780 |
bool update(Session *session, set_var *var); |
781 |
void set_default(Session *session, enum_var_type type); |
|
782 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
1
by brian
clean slate |
783 |
};
|
784 |
||
785 |
||
786 |
class sys_var_key_cache_param :public sys_var |
|
787 |
{
|
|
788 |
protected: |
|
789 |
size_t offset; |
|
790 |
public: |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
791 |
sys_var_key_cache_param(sys_var_chain *chain, const char *name_arg, |
1
by brian
clean slate |
792 |
size_t offset_arg) |
793 |
:sys_var(name_arg), offset(offset_arg) |
|
794 |
{ chain_sys_var(chain); } |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
795 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
644
by Brian Aker
Clean up warnings for Solaris. |
796 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
797 |
{ return 1; } |
1
by brian
clean slate |
798 |
bool is_struct() { return 1; } |
799 |
};
|
|
800 |
||
801 |
||
802 |
class sys_var_key_buffer_size :public sys_var_key_cache_param |
|
803 |
{
|
|
804 |
public: |
|
805 |
sys_var_key_buffer_size(sys_var_chain *chain, const char *name_arg) |
|
806 |
:sys_var_key_cache_param(chain, name_arg, |
|
807 |
offsetof(KEY_CACHE, param_buff_size)) |
|
808 |
{}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
809 |
bool update(Session *session, set_var *var); |
1
by brian
clean slate |
810 |
SHOW_TYPE show_type() { return SHOW_LONGLONG; } |
811 |
};
|
|
812 |
||
813 |
||
814 |
class sys_var_key_cache_long :public sys_var_key_cache_param |
|
815 |
{
|
|
816 |
public: |
|
817 |
sys_var_key_cache_long(sys_var_chain *chain, const char *name_arg, size_t offset_arg) |
|
818 |
:sys_var_key_cache_param(chain, name_arg, offset_arg) |
|
819 |
{}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
820 |
bool update(Session *session, set_var *var); |
1
by brian
clean slate |
821 |
SHOW_TYPE show_type() { return SHOW_LONG; } |
822 |
};
|
|
823 |
||
824 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
825 |
class sys_var_session_date_time_format :public sys_var_session |
1
by brian
clean slate |
826 |
{
|
827 |
DATE_TIME_FORMAT *SV::*offset; |
|
398.1.1
by Monty Taylor
Remove typedef enum enum_drizzle_timestamp_type timestamp_type; |
828 |
enum enum_drizzle_timestamp_type date_time_type; |
1
by brian
clean slate |
829 |
public: |
520.1.22
by Brian Aker
Second pass of thd cleanup |
830 |
sys_var_session_date_time_format(sys_var_chain *chain, const char *name_arg, |
1
by brian
clean slate |
831 |
DATE_TIME_FORMAT *SV::*offset_arg, |
398.1.1
by Monty Taylor
Remove typedef enum enum_drizzle_timestamp_type timestamp_type; |
832 |
enum enum_drizzle_timestamp_type date_time_type_arg) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
833 |
:sys_var_session(name_arg), offset(offset_arg), |
1
by brian
clean slate |
834 |
date_time_type(date_time_type_arg) |
835 |
{ chain_sys_var(chain); } |
|
836 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
|
837 |
bool check_update_type(Item_result type) |
|
838 |
{
|
|
839 |
return type != STRING_RESULT; /* Only accept strings */ |
|
840 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
841 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
842 |
{ return 0; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
843 |
bool check(Session *session, set_var *var); |
844 |
bool update(Session *session, set_var *var); |
|
845 |
void update2(Session *session, enum_var_type type, DATE_TIME_FORMAT *new_value); |
|
846 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
847 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
848 |
};
|
849 |
||
850 |
||
851 |
class sys_var_log_state :public sys_var_bool_ptr |
|
852 |
{
|
|
482
by Brian Aker
Remove uint. |
853 |
uint32_t log_type; |
1
by brian
clean slate |
854 |
public: |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
855 |
sys_var_log_state(sys_var_chain *chain, const char *name_arg, bool *value_arg, |
482
by Brian Aker
Remove uint. |
856 |
uint32_t log_type_arg) |
1
by brian
clean slate |
857 |
:sys_var_bool_ptr(chain, name_arg, value_arg), log_type(log_type_arg) {} |
520.1.22
by Brian Aker
Second pass of thd cleanup |
858 |
bool update(Session *session, set_var *var); |
859 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
860 |
};
|
861 |
||
862 |
/* Variable that you can only read from */
|
|
863 |
||
864 |
class sys_var_readonly: public sys_var |
|
865 |
{
|
|
866 |
public: |
|
867 |
enum_var_type var_type; |
|
868 |
SHOW_TYPE show_type_value; |
|
869 |
sys_value_ptr_func value_ptr_func; |
|
870 |
sys_var_readonly(sys_var_chain *chain, const char *name_arg, enum_var_type type, |
|
871 |
SHOW_TYPE show_type_arg, |
|
872 |
sys_value_ptr_func value_ptr_func_arg) |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
873 |
:sys_var(name_arg), var_type(type), |
1
by brian
clean slate |
874 |
show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg) |
875 |
{ chain_sys_var(chain); } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
876 |
bool update(Session *, set_var *) |
77.1.7
by Monty Taylor
Heap builds clean. |
877 |
{ return 1; } |
644
by Brian Aker
Clean up warnings for Solaris. |
878 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
879 |
{ return 1; } |
1
by brian
clean slate |
880 |
bool check_type(enum_var_type type) { return type != var_type; } |
644
by Brian Aker
Clean up warnings for Solaris. |
881 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
882 |
{ return 1; } |
644
by Brian Aker
Clean up warnings for Solaris. |
883 |
unsigned char *value_ptr(Session *session, enum_var_type, LEX_STRING *) |
1
by brian
clean slate |
884 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
885 |
return (*value_ptr_func)(session); |
1
by brian
clean slate |
886 |
}
|
77.1.7
by Monty Taylor
Heap builds clean. |
887 |
SHOW_TYPE show_type(void) { return show_type_value; } |
888 |
bool is_readonly(void) const { return 1; } |
|
1
by brian
clean slate |
889 |
};
|
890 |
||
891 |
||
892 |
class sys_var_have_option: public sys_var |
|
893 |
{
|
|
894 |
protected: |
|
895 |
virtual SHOW_COMP_OPTION get_option() = 0; |
|
896 |
public: |
|
897 |
sys_var_have_option(sys_var_chain *chain, const char *variable_name): |
|
898 |
sys_var(variable_name) |
|
899 |
{ chain_sys_var(chain); } |
|
644
by Brian Aker
Clean up warnings for Solaris. |
900 |
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *) |
1
by brian
clean slate |
901 |
{
|
481
by Brian Aker
Remove all of uchar. |
902 |
return (unsigned char*) show_comp_option_name[get_option()]; |
1
by brian
clean slate |
903 |
}
|
644
by Brian Aker
Clean up warnings for Solaris. |
904 |
bool update(Session *, set_var *) { return 1; } |
905 |
bool check_default(enum_var_type) |
|
77.1.7
by Monty Taylor
Heap builds clean. |
906 |
{ return 1; } |
1
by brian
clean slate |
907 |
bool check_type(enum_var_type type) { return type != OPT_GLOBAL; } |
644
by Brian Aker
Clean up warnings for Solaris. |
908 |
bool check_update_type(Item_result) |
77.1.7
by Monty Taylor
Heap builds clean. |
909 |
{ return 1; } |
1
by brian
clean slate |
910 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
911 |
bool is_readonly() const { return 1; } |
|
912 |
};
|
|
913 |
||
914 |
||
915 |
class sys_var_have_variable: public sys_var_have_option |
|
916 |
{
|
|
917 |
SHOW_COMP_OPTION *have_variable; |
|
918 |
||
919 |
public: |
|
920 |
sys_var_have_variable(sys_var_chain *chain, const char *variable_name, |
|
921 |
SHOW_COMP_OPTION *have_variable_arg): |
|
922 |
sys_var_have_option(chain, variable_name), |
|
923 |
have_variable(have_variable_arg) |
|
924 |
{ } |
|
925 |
SHOW_COMP_OPTION get_option() { return *have_variable; } |
|
926 |
};
|
|
927 |
||
928 |
||
929 |
class sys_var_have_plugin: public sys_var_have_option |
|
930 |
{
|
|
931 |
const char *plugin_name_str; |
|
482
by Brian Aker
Remove uint. |
932 |
const uint32_t plugin_name_len; |
1
by brian
clean slate |
933 |
const int plugin_type; |
934 |
||
935 |
public: |
|
936 |
sys_var_have_plugin(sys_var_chain *chain, const char *variable_name, |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
937 |
const char *plugin_name_str_arg, uint32_t plugin_name_len_arg, |
1
by brian
clean slate |
938 |
int plugin_type_arg): |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
939 |
sys_var_have_option(chain, variable_name), |
1
by brian
clean slate |
940 |
plugin_name_str(plugin_name_str_arg), plugin_name_len(plugin_name_len_arg), |
941 |
plugin_type(plugin_type_arg) |
|
942 |
{ } |
|
943 |
/* the following method is declared in sql_plugin.cc */
|
|
944 |
SHOW_COMP_OPTION get_option(); |
|
945 |
};
|
|
946 |
||
947 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
948 |
class sys_var_session_time_zone :public sys_var_session |
1
by brian
clean slate |
949 |
{
|
950 |
public: |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
951 |
sys_var_session_time_zone(sys_var_chain *chain, const char *name_arg, |
1
by brian
clean slate |
952 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
953 |
:sys_var_session(name_arg, NULL, binlog_status_arg) |
1
by brian
clean slate |
954 |
{
|
955 |
no_support_one_shot= 0; |
|
956 |
chain_sys_var(chain); |
|
957 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
958 |
bool check(Session *session, set_var *var); |
1
by brian
clean slate |
959 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
960 |
bool check_update_type(Item_result type) |
|
961 |
{
|
|
962 |
return type != STRING_RESULT; /* Only accept strings */ |
|
963 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
964 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
965 |
{ return 0; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
966 |
bool update(Session *session, set_var *var); |
967 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
968 |
virtual void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
969 |
};
|
970 |
||
971 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
972 |
class sys_var_microseconds :public sys_var_session |
1
by brian
clean slate |
973 |
{
|
151
by Brian Aker
Ulonglong to uint64_t |
974 |
uint64_t SV::*offset; |
1
by brian
clean slate |
975 |
public: |
976 |
sys_var_microseconds(sys_var_chain *chain, const char *name_arg, |
|
151
by Brian Aker
Ulonglong to uint64_t |
977 |
uint64_t SV::*offset_arg): |
520.1.22
by Brian Aker
Second pass of thd cleanup |
978 |
sys_var_session(name_arg), offset(offset_arg) |
1
by brian
clean slate |
979 |
{ chain_sys_var(chain); } |
644
by Brian Aker
Clean up warnings for Solaris. |
980 |
bool check(Session *, set_var *) {return 0;} |
520.1.22
by Brian Aker
Second pass of thd cleanup |
981 |
bool update(Session *session, set_var *var); |
982 |
void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
983 |
SHOW_TYPE show_type() { return SHOW_DOUBLE; } |
984 |
bool check_update_type(Item_result type) |
|
985 |
{
|
|
986 |
return (type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT); |
|
987 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
988 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
1
by brian
clean slate |
989 |
};
|
990 |
||
991 |
/**
|
|
992 |
Handler for setting the system variable --read-only.
|
|
993 |
*/
|
|
994 |
||
995 |
class sys_var_opt_readonly :public sys_var_bool_ptr |
|
996 |
{
|
|
997 |
public: |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
998 |
sys_var_opt_readonly(sys_var_chain *chain, const char *name_arg, |
147
by Brian Aker
More my_bool conversion. This time the set_var class. |
999 |
bool *value_arg) : |
1
by brian
clean slate |
1000 |
sys_var_bool_ptr(chain, name_arg, value_arg) {}; |
1001 |
~sys_var_opt_readonly() {}; |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1002 |
bool update(Session *session, set_var *var); |
1
by brian
clean slate |
1003 |
};
|
1004 |
||
1005 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1006 |
class sys_var_session_lc_time_names :public sys_var_session |
1
by brian
clean slate |
1007 |
{
|
1008 |
public: |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1009 |
sys_var_session_lc_time_names(sys_var_chain *chain, const char *name_arg, |
1
by brian
clean slate |
1010 |
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG) |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1011 |
: sys_var_session(name_arg, NULL, binlog_status_arg) |
1
by brian
clean slate |
1012 |
{
|
1013 |
chain_sys_var(chain); |
|
1014 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1015 |
bool check(Session *session, set_var *var); |
1
by brian
clean slate |
1016 |
SHOW_TYPE show_type() { return SHOW_CHAR; } |
1017 |
bool check_update_type(Item_result type) |
|
1018 |
{
|
|
1019 |
return ((type != STRING_RESULT) && (type != INT_RESULT)); |
|
1020 |
}
|
|
644
by Brian Aker
Clean up warnings for Solaris. |
1021 |
bool check_default(enum_var_type) |
77.1.7
by Monty Taylor
Heap builds clean. |
1022 |
{ return 0; } |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1023 |
bool update(Session *session, set_var *var); |
1024 |
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base); |
|
1025 |
virtual void set_default(Session *session, enum_var_type type); |
|
1
by brian
clean slate |
1026 |
};
|
1027 |
||
1028 |
||
1029 |
/****************************************************************************
|
|
1030 |
Classes for parsing of the SET command
|
|
1031 |
****************************************************************************/
|
|
1032 |
||
1033 |
class set_var_base :public Sql_alloc |
|
1034 |
{
|
|
1035 |
public: |
|
1036 |
set_var_base() {} |
|
1037 |
virtual ~set_var_base() {} |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1038 |
virtual int check(Session *session)=0; /* To check privileges etc. */ |
1039 |
virtual int update(Session *session)=0; /* To set the value */ |
|
1
by brian
clean slate |
1040 |
/* light check for PS */
|
1041 |
virtual bool no_support_one_shot() { return 1; } |
|
1042 |
};
|
|
1043 |
||
1044 |
||
141
by Brian Aker
Code cleanup. Mainly dead stuff :) |
1045 |
/* MySQL internal variables */
|
1
by brian
clean slate |
1046 |
|
1047 |
class set_var :public set_var_base |
|
1048 |
{
|
|
1049 |
public: |
|
1050 |
sys_var *var; |
|
1051 |
Item *value; |
|
1052 |
enum_var_type type; |
|
1053 |
union
|
|
1054 |
{
|
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
1055 |
const CHARSET_INFO *charset; |
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. |
1056 |
uint32_t uint32_t_value; |
151
by Brian Aker
Ulonglong to uint64_t |
1057 |
uint64_t uint64_t_value; |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
1058 |
size_t size_t_value; |
1
by brian
clean slate |
1059 |
plugin_ref plugin; |
1060 |
DATE_TIME_FORMAT *date_time_format; |
|
1061 |
Time_zone *time_zone; |
|
1062 |
MY_LOCALE *locale_value; |
|
1063 |
} save_result; |
|
1064 |
LEX_STRING base; /* for structs */ |
|
1065 |
||
1066 |
set_var(enum_var_type type_arg, sys_var *var_arg, |
|
1067 |
const LEX_STRING *base_name_arg, Item *value_arg) |
|
1068 |
:var(var_arg), type(type_arg), base(*base_name_arg) |
|
1069 |
{
|
|
1070 |
/*
|
|
1071 |
If the set value is a field, change it to a string to allow things like
|
|
1072 |
SET table_type=MYISAM;
|
|
1073 |
*/
|
|
1074 |
if (value_arg && value_arg->type() == Item::FIELD_ITEM) |
|
1075 |
{
|
|
1076 |
Item_field *item= (Item_field*) value_arg; |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
1077 |
if (!(value=new Item_string(item->field_name, |
1
by brian
clean slate |
1078 |
(uint) strlen(item->field_name), |
1079 |
item->collation.collation))) |
|
1080 |
value=value_arg; /* Give error message later */ |
|
1081 |
}
|
|
1082 |
else
|
|
1083 |
value=value_arg; |
|
1084 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1085 |
int check(Session *session); |
1086 |
int update(Session *session); |
|
1
by brian
clean slate |
1087 |
bool no_support_one_shot() { return var->no_support_one_shot; } |
1088 |
};
|
|
1089 |
||
1090 |
||
1091 |
/* User variables like @my_own_variable */
|
|
1092 |
||
1093 |
class set_var_user: public set_var_base |
|
1094 |
{
|
|
1095 |
Item_func_set_user_var *user_var_item; |
|
1096 |
public: |
|
1097 |
set_var_user(Item_func_set_user_var *item) |
|
1098 |
:user_var_item(item) |
|
1099 |
{}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1100 |
int check(Session *session); |
1101 |
int update(Session *session); |
|
1
by brian
clean slate |
1102 |
};
|
1103 |
||
1104 |
/* For SET NAMES and SET CHARACTER SET */
|
|
1105 |
||
1106 |
class set_var_collation_client: public set_var_base |
|
1107 |
{
|
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
1108 |
const CHARSET_INFO *character_set_client; |
1109 |
const CHARSET_INFO *character_set_results; |
|
1110 |
const CHARSET_INFO *collation_connection; |
|
1
by brian
clean slate |
1111 |
public: |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
1112 |
set_var_collation_client(const CHARSET_INFO * const client_coll_arg, |
1113 |
const CHARSET_INFO * const connection_coll_arg, |
|
1114 |
const CHARSET_INFO * const result_coll_arg) |
|
1
by brian
clean slate |
1115 |
:character_set_client(client_coll_arg), |
1116 |
character_set_results(result_coll_arg), |
|
1117 |
collation_connection(connection_coll_arg) |
|
1118 |
{}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1119 |
int check(Session *session); |
1120 |
int update(Session *session); |
|
1
by brian
clean slate |
1121 |
};
|
1122 |
||
1123 |
||
1124 |
extern "C" |
|
1125 |
{
|
|
1126 |
typedef int (*process_key_cache_t) (const char *, KEY_CACHE *); |
|
1127 |
}
|
|
1128 |
||
1129 |
/* Named lists (used for keycaches) */
|
|
1130 |
||
1131 |
class NAMED_LIST :public ilink |
|
1132 |
{
|
|
656.1.34
by Monty Taylor
Got closer... |
1133 |
std::string name; |
1
by brian
clean slate |
1134 |
public: |
481
by Brian Aker
Remove all of uchar. |
1135 |
unsigned char* data; |
1
by brian
clean slate |
1136 |
|
1137 |
NAMED_LIST(I_List<NAMED_LIST> *links, const char *name_arg, |
|
656.1.34
by Monty Taylor
Got closer... |
1138 |
uint32_t name_length_arg, unsigned char* data_arg); |
1139 |
bool cmp(const char *name_cmp, uint32_t length); |
|
1
by brian
clean slate |
1140 |
friend bool process_key_caches(process_key_cache_t func); |
1141 |
friend void delete_elements(I_List<NAMED_LIST> *list, |
|
656.1.34
by Monty Taylor
Got closer... |
1142 |
void (*free_element)(const char*, |
1143 |
unsigned char*)); |
|
1
by brian
clean slate |
1144 |
};
|
1145 |
||
1146 |
/* updated in sql_acl.cc */
|
|
1147 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1148 |
extern sys_var_session_bool sys_old_alter_table; |
1
by brian
clean slate |
1149 |
extern LEX_STRING default_key_cache_base; |
1150 |
||
1151 |
/* For sql_yacc */
|
|
1152 |
struct sys_var_with_base |
|
1153 |
{
|
|
1154 |
sys_var *var; |
|
1155 |
LEX_STRING base_name; |
|
1156 |
};
|
|
1157 |
||
1158 |
/*
|
|
1159 |
Prototypes for helper functions
|
|
1160 |
*/
|
|
1161 |
||
1162 |
int set_var_init(); |
|
1163 |
void set_var_free(); |
|
482
by Brian Aker
Remove uint. |
1164 |
int mysql_append_static_vars(const SHOW_VAR *show_vars, uint32_t count); |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1165 |
SHOW_VAR* enumerate_sys_vars(Session *session, bool sorted); |
1
by brian
clean slate |
1166 |
int mysql_add_sys_var_chain(sys_var *chain, struct my_option *long_options); |
1167 |
int mysql_del_sys_var_chain(sys_var *chain); |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1168 |
sys_var *find_sys_var(Session *session, const char *str, uint32_t length=0); |
1169 |
int sql_set_variables(Session *session, List<set_var_base> *var_list); |
|
1
by brian
clean slate |
1170 |
bool not_all_support_one_shot(List<set_var_base> *var_list); |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1171 |
void fix_delay_key_write(Session *session, enum_var_type type); |
1
by brian
clean slate |
1172 |
void fix_slave_exec_mode(enum_var_type type); |
1173 |
extern sys_var_str sys_init_connect; |
|
1174 |
extern sys_var_str sys_init_slave; |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1175 |
extern sys_var_session_time_zone sys_time_zone; |
1176 |
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. |
1177 |
const CHARSET_INFO *get_old_charset_by_name(const char *old_name); |
482
by Brian Aker
Remove uint. |
1178 |
unsigned char* find_named(I_List<NAMED_LIST> *list, const char *name, uint32_t length, |
1
by brian
clean slate |
1179 |
NAMED_LIST **found); |
1180 |
||
1181 |
extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path; |
|
1182 |
||
1183 |
/* key_cache functions */
|
|
1184 |
KEY_CACHE *get_key_cache(LEX_STRING *cache_name); |
|
482
by Brian Aker
Remove uint. |
1185 |
KEY_CACHE *get_or_create_key_cache(const char *name, uint32_t length); |
1
by brian
clean slate |
1186 |
void free_key_cache(const char *name, KEY_CACHE *key_cache); |
1187 |
bool process_key_caches(process_key_cache_t func); |
|
1188 |
void delete_elements(I_List<NAMED_LIST> *list, |
|
481
by Brian Aker
Remove all of uchar. |
1189 |
void (*free_element)(const char*, unsigned char*)); |
575.1.6
by Monty Taylor
Cleaned up some headers for PCH. |
1190 |
|
1191 |
#endif /* DRIZZLED_ITEM_SET_H */ |