180
177
* A base class for all variables that require its access to
181
178
* be guarded with a mutex.
183
class DRIZZLED_API sys_var_global: public sys_var
180
class DRIZZLED_API sys_var_global : public sys_var
186
183
pthread_mutex_t *guard;
188
sys_var_global(const char *name_arg,
189
sys_after_update_func after_update_arg,
190
pthread_mutex_t *guard_arg)
192
sys_var(name_arg, after_update_arg),
185
sys_var_global(const char *name_arg, sys_after_update_func after_update_arg, pthread_mutex_t *guard_arg) :
186
sys_var(name_arg, after_update_arg),
197
class DRIZZLED_API sys_var_uint32_t_ptr :public sys_var
191
class DRIZZLED_API sys_var_uint32_t_ptr : public sys_var
201
sys_var_uint32_t_ptr(const char *name_arg,
202
uint32_t *value_ptr_arg)
203
:sys_var(name_arg),value(value_ptr_arg)
195
sys_var_uint32_t_ptr(const char *name_arg, uint32_t *value_ptr_arg) :
196
sys_var(name_arg), value(value_ptr_arg)
205
sys_var_uint32_t_ptr(const char *name_arg,
206
uint32_t *value_ptr_arg,
207
sys_after_update_func func)
208
:sys_var(name_arg,func), value(value_ptr_arg)
198
sys_var_uint32_t_ptr(const char *name_arg, uint32_t *value_ptr_arg, sys_after_update_func func) :
199
sys_var(name_arg,func), value(value_ptr_arg)
210
201
bool check(Session *session, set_var *var);
211
202
bool update(Session *session, set_var *var);
212
203
void set_default(Session *session, sql_var_t type);
213
204
SHOW_TYPE show_type() { return SHOW_INT; }
214
unsigned char *value_ptr(Session *, sql_var_t, const lex_string_t *)
205
unsigned char *value_ptr(Session *, sql_var_t)
215
206
{ return (unsigned char*) value; }
218
class DRIZZLED_API sys_var_uint32_t_ptr_readonly :
219
public sys_var_uint32_t_ptr
209
class DRIZZLED_API sys_var_uint32_t_ptr_readonly : public sys_var_uint32_t_ptr
222
sys_var_uint32_t_ptr_readonly(const char *name_arg,
223
uint32_t *value_ptr_arg) :
212
sys_var_uint32_t_ptr_readonly(const char *name_arg, uint32_t *value_ptr_arg) :
224
213
sys_var_uint32_t_ptr(name_arg, value_ptr_arg)
285
274
return (not have_default_value) && option_limits == 0;
287
276
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
288
unsigned char *value_ptr(Session *, sql_var_t,
289
const lex_string_t *)
277
unsigned char *value_ptr(Session *, sql_var_t)
290
278
{ return (unsigned char*) value; }
304
292
bool update(Session *session, set_var *var);
305
293
void set_default(Session *session, sql_var_t type);
306
294
SHOW_TYPE show_type() { return SHOW_SIZE; }
307
unsigned char *value_ptr(Session *, sql_var_t, const lex_string_t *)
295
unsigned char *value_ptr(Session *, sql_var_t)
308
296
{ return (unsigned char*) value; }
335
323
bool update(Session *session, set_var *var);
336
324
void set_default(Session *session, sql_var_t type);
337
325
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
338
unsigned char *value_ptr(Session *, sql_var_t, const lex_string_t *)
326
unsigned char *value_ptr(Session *, sql_var_t)
339
327
{ return (unsigned char*) value; }
340
328
bool check_update_type(Item_result)
379
367
(*set_default_func)(session, type);
381
369
SHOW_TYPE show_type() { return SHOW_CHAR; }
382
unsigned char *value_ptr(Session *, sql_var_t, const lex_string_t *)
370
unsigned char *value_ptr(Session *, sql_var_t)
383
371
{ return (unsigned char*) value; }
384
372
bool check_update_type(Item_result type)
771
759
bool update(Session *session, set_var *var);
772
760
void set_default(Session *session, sql_var_t type);
773
761
SHOW_TYPE show_type() { return SHOW_INT; }
774
unsigned char *value_ptr(Session *session, sql_var_t type,
775
const lex_string_t *base);
762
unsigned char *value_ptr(Session *session, sql_var_t type);
792
779
bool update(Session *session, set_var *var);
793
780
void set_default(Session *session, sql_var_t type);
794
781
SHOW_TYPE show_type() { return SHOW_HA_ROWS; }
795
unsigned char *value_ptr(Session *session, sql_var_t type,
796
const lex_string_t *base);
782
unsigned char *value_ptr(Session *session, sql_var_t type);
825
811
bool update(Session *session, set_var *var);
826
812
void set_default(Session *session, sql_var_t type);
827
813
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
828
unsigned char *value_ptr(Session *session, sql_var_t type,
829
const lex_string_t *base);
814
unsigned char *value_ptr(Session *session, sql_var_t type);
830
815
bool check(Session *session, set_var *var);
831
816
bool check_default(sql_var_t type)
865
850
bool update(Session *session, set_var *var);
866
851
void set_default(Session *session, sql_var_t type);
867
852
SHOW_TYPE show_type() { return SHOW_SIZE; }
868
unsigned char *value_ptr(Session *session, sql_var_t type,
869
const lex_string_t *base);
853
unsigned char *value_ptr(Session *session, sql_var_t type);
870
854
bool check(Session *session, set_var *var);
871
855
bool check_default(sql_var_t type)
893
877
bool update(Session *session, set_var *var);
894
878
void set_default(Session *session, sql_var_t type);
895
879
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
896
unsigned char *value_ptr(Session *session, sql_var_t type,
897
const lex_string_t *base);
880
unsigned char *value_ptr(Session *session, sql_var_t type);
898
881
bool check(Session *session, set_var *var);
899
882
bool check_update_type(Item_result)
925
908
bool update(Session *session, set_var *var);
926
909
void set_default(Session *session, sql_var_t type);
927
910
SHOW_TYPE show_type() { return SHOW_CHAR; }
928
unsigned char *value_ptr(Session *session, sql_var_t type,
929
const lex_string_t *base);
911
unsigned char *value_ptr(Session *session, sql_var_t type);
930
912
bool check_update_type(Item_result)
949
931
void set_default(Session *session, sql_var_t type);
950
932
bool update(Session *session, set_var *var);
951
unsigned char *value_ptr(Session *session, sql_var_t type,
952
const lex_string_t *base);
933
unsigned char *value_ptr(Session *session, sql_var_t type);
955
936
class DRIZZLED_API sys_var_session_bit :public sys_var_session
972
953
bool check_type(sql_var_t type) { return type == OPT_GLOBAL; }
973
954
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
974
unsigned char *value_ptr(Session *session, sql_var_t type,
975
const lex_string_t *base);
955
unsigned char *value_ptr(Session *session, sql_var_t type);
978
958
/* some variables that require special handling */
989
969
bool check_default(sql_var_t)
991
971
SHOW_TYPE show_type(void) { return SHOW_LONG; }
992
unsigned char *value_ptr(Session *session, sql_var_t type,
993
const lex_string_t *base);
972
unsigned char *value_ptr(Session *session, sql_var_t type);
1003
982
bool update(Session *session, set_var *var);
1004
983
bool check_type(sql_var_t type) { return type == OPT_GLOBAL; }
1005
984
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
1006
unsigned char *value_ptr(Session *session, sql_var_t type,
1007
const lex_string_t *base);
985
unsigned char *value_ptr(Session *session, sql_var_t type);
1039
1017
bool update(Session *session, set_var *var);
1040
1018
void set_default(Session *session, sql_var_t type);
1041
unsigned char *value_ptr(Session *session, sql_var_t type,
1042
const lex_string_t *base);
1019
unsigned char *value_ptr(Session *session, sql_var_t type);
1045
1022
/* Variable that you can only read from */
1063
1040
bool check_type(sql_var_t type) { return type != var_type; }
1064
1041
bool check_update_type(Item_result)
1066
unsigned char *value_ptr(Session *session, sql_var_t,
1067
const lex_string_t *)
1043
unsigned char *value_ptr(Session *session, sql_var_t)
1069
1045
return (*value_ptr_func)(session);
1106
1082
bool check_default(sql_var_t)
1108
1084
bool update(Session *session, set_var *var);
1109
unsigned char *value_ptr(Session *session, sql_var_t type,
1110
const lex_string_t *base);
1085
unsigned char *value_ptr(Session *session, sql_var_t type);
1111
1086
virtual void set_default(Session *session, sql_var_t type);