98
98
bool check_enum(Session *session, set_var *var, const TYPELIB *enum_names);
99
99
bool check_set(Session *session, set_var *var, TYPELIB *enum_names);
100
100
virtual bool update(Session *session, set_var *var)=0;
101
virtual void set_default(Session *session_arg __attribute__((unused)),
102
enum_var_type type __attribute__((unused)))
101
virtual void set_default(Session *, enum_var_type)
104
103
virtual SHOW_TYPE show_type() { return SHOW_UNDEF; }
105
virtual unsigned char *value_ptr(Session *session __attribute__((unused)),
106
enum_var_type type __attribute__((unused)),
107
LEX_STRING *base __attribute__((unused)))
104
virtual unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
109
106
virtual bool check_type(enum_var_type type)
110
107
{ return type != OPT_GLOBAL; } /* Error if not GLOBAL */
111
108
virtual bool check_update_type(Item_result type)
112
109
{ return type != INT_RESULT; } /* Assume INT */
113
virtual bool check_default(enum_var_type type __attribute__((unused)))
110
virtual bool check_default(enum_var_type)
114
111
{ return option_limits == 0; }
115
112
Item *item(Session *session, enum_var_type type, LEX_STRING *base);
116
113
virtual bool is_struct() { return 0; }
166
163
bool update(Session *session, set_var *var);
167
164
void set_default(Session *session, enum_var_type type);
168
165
SHOW_TYPE show_type() { return SHOW_LONG; }
169
unsigned char *value_ptr(Session *session __attribute__((unused)),
170
enum_var_type type __attribute__((unused)),
171
LEX_STRING *base __attribute__((unused)))
166
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
172
167
{ return (unsigned char*) value; }
201
196
bool update(Session *session, set_var *var);
202
197
void set_default(Session *session, enum_var_type type);
203
198
SHOW_TYPE show_type() { return SHOW_LONG; }
204
unsigned char *value_ptr(Session *session __attribute__((unused)),
205
enum_var_type type __attribute__((unused)),
206
LEX_STRING *base __attribute__((unused)))
199
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
207
200
{ return (unsigned char*) value; }
222
215
bool update(Session *session, set_var *var);
223
216
void set_default(Session *session, enum_var_type type);
224
217
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
225
unsigned char *value_ptr(Session *session __attribute__((unused)),
226
enum_var_type type __attribute__((unused)),
227
LEX_STRING *base __attribute__((unused)))
218
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
228
219
{ return (unsigned char*) value; }
242
233
bool update(Session *session, set_var *var);
243
234
void set_default(Session *session, enum_var_type type);
244
235
SHOW_TYPE show_type() { return SHOW_SIZE; }
245
unsigned char *value_ptr(Session *session __attribute__((unused)),
246
enum_var_type type __attribute__((unused)),
247
LEX_STRING *base __attribute__((unused)))
236
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
248
237
{ return (unsigned char*) value; }
262
251
bool update(Session *session, set_var *var);
263
252
void set_default(Session *session, enum_var_type type);
264
253
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
265
unsigned char *value_ptr(Session *session __attribute__((unused)),
266
enum_var_type type __attribute__((unused)),
267
LEX_STRING *base __attribute__((unused)))
254
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
268
255
{ return (unsigned char*) value; }
269
bool check_update_type(Item_result type __attribute__((unused)))
256
bool check_update_type(Item_result)
307
294
(*set_default_func)(session, type);
309
296
SHOW_TYPE show_type() { return SHOW_CHAR; }
310
unsigned char *value_ptr(Session *session __attribute__((unused)),
311
enum_var_type type __attribute__((unused)),
312
LEX_STRING *base __attribute__((unused)))
297
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
313
298
{ return (unsigned char*) value; }
314
299
bool check_update_type(Item_result type)
316
301
return type != STRING_RESULT; /* Only accept strings */
318
bool check_default(enum_var_type type __attribute__((unused)))
303
bool check_default(enum_var_type)
333
318
value= new_value;
335
bool check(Session *session __attribute__((unused)),
336
set_var *var __attribute__((unused)))
320
bool check(Session *, set_var *)
340
bool update(Session *session __attribute__((unused)),
341
set_var *var __attribute__((unused)))
324
bool update(Session *, set_var *)
345
328
SHOW_TYPE show_type() { return SHOW_CHAR; }
346
unsigned char *value_ptr(Session *session __attribute__((unused)),
347
enum_var_type type __attribute__((unused)),
348
LEX_STRING *base __attribute__((unused)))
329
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
350
331
return (unsigned char*) value;
352
bool check_update_type(Item_result type __attribute__((unused)))
333
bool check_update_type(Item_result)
356
bool check_default(enum_var_type type __attribute__((unused)))
337
bool check_default(enum_var_type)
358
339
bool is_readonly() const { return 1; }
366
347
sys_var_const_str_ptr(sys_var_chain *chain, const char *name_arg, char **value_arg)
367
348
:sys_var(name_arg),value(value_arg)
368
349
{ chain_sys_var(chain); }
369
bool check(Session *session __attribute__((unused)),
370
set_var *var __attribute__((unused)))
350
bool check(Session *, set_var *)
374
bool update(Session *session __attribute__((unused)),
375
set_var *var __attribute__((unused)))
354
bool update(Session *, set_var *)
379
358
SHOW_TYPE show_type() { return SHOW_CHAR; }
380
unsigned char *value_ptr(Session *session __attribute__((unused)),
381
enum_var_type type __attribute__((unused)),
382
LEX_STRING *base __attribute__((unused)))
359
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
384
361
return (unsigned char*) *value;
386
bool check_update_type(Item_result type __attribute__((unused)))
363
bool check_update_type(Item_result)
390
bool check_default(enum_var_type type __attribute__((unused)))
367
bool check_default(enum_var_type)
392
369
bool is_readonly(void) const { return 1; }
409
386
bool update(Session *session, set_var *var);
410
387
SHOW_TYPE show_type() { return SHOW_CHAR; }
411
388
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
412
bool check_update_type(Item_result type __attribute__((unused)))
389
bool check_update_type(Item_result)
423
400
TYPELIB *typelib, sys_after_update_func func)
424
401
:sys_var(name_arg,func), offset(offset_arg), enum_names(typelib)
425
402
{ chain_sys_var(chain); }
426
bool check(Session *session __attribute__((unused)),
427
set_var *var __attribute__((unused)))
403
bool check(Session *, set_var *)
429
bool update(Session *session __attribute__((unused)),
430
set_var *var __attribute__((unused)))
405
bool update(Session *, set_var *)
432
407
SHOW_TYPE show_type() { return SHOW_CHAR; }
433
bool check_update_type(Item_result type __attribute__((unused)))
408
bool check_update_type(Item_result)
435
410
bool is_readonly() const { return 1; }
436
411
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
445
420
Binlog_status_enum binlog_status= NOT_IN_BINLOG)
446
421
:sys_var(name_arg, func, binlog_status)
448
bool check_type(enum_var_type type __attribute__((unused)))
423
bool check_type(enum_var_type)
450
425
bool check_default(enum_var_type type)
626
601
void set_default(Session *session, enum_var_type type);
627
602
SHOW_TYPE show_type() { return SHOW_CHAR; }
628
603
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
629
bool check_update_type(Item_result type __attribute__((unused)))
604
bool check_update_type(Item_result)
686
661
{ chain_sys_var(chain); }
687
662
bool check(Session *session, set_var *var);
688
663
bool update(Session *session, set_var *var);
689
bool check_update_type(Item_result type __attribute__((unused)))
664
bool check_update_type(Item_result)
691
666
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
692
667
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
705
680
bool update(Session *session, set_var *var);
706
681
void set_default(Session *session, enum_var_type type);
707
682
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
708
bool check_default(enum_var_type type __attribute__((unused)))
683
bool check_default(enum_var_type)
710
685
SHOW_TYPE show_type(void) { return SHOW_LONG; }
711
686
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
755
730
return ((type != STRING_RESULT) && (type != INT_RESULT));
757
bool check_default(enum_var_type type __attribute__((unused))) { return 0; }
732
bool check_default(enum_var_type) { return 0; }
758
733
virtual void set_default(Session *session, enum_var_type type)= 0;
779
754
return ((type != STRING_RESULT) && (type != INT_RESULT));
781
bool check_default(enum_var_type type __attribute__((unused)))
756
bool check_default(enum_var_type)
783
758
bool update(Session *session, set_var *var);
784
759
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
816
791
:sys_var(name_arg), offset(offset_arg)
817
792
{ chain_sys_var(chain); }
818
793
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
819
bool check_default(enum_var_type type __attribute__((unused)))
794
bool check_default(enum_var_type)
821
796
bool is_struct() { return 1; }
862
837
return type != STRING_RESULT; /* Only accept strings */
864
bool check_default(enum_var_type type __attribute__((unused)))
839
bool check_default(enum_var_type)
866
841
bool check(Session *session, set_var *var);
867
842
bool update(Session *session, set_var *var);
896
871
:sys_var(name_arg), var_type(type),
897
872
show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg)
898
873
{ chain_sys_var(chain); }
899
bool update(Session *session __attribute__((unused)),
900
set_var *var __attribute__((unused)))
874
bool update(Session *, set_var *)
902
bool check_default(enum_var_type type __attribute__((unused)))
876
bool check_default(enum_var_type)
904
878
bool check_type(enum_var_type type) { return type != var_type; }
905
bool check_update_type(Item_result type __attribute__((unused)))
879
bool check_update_type(Item_result)
907
unsigned char *value_ptr(Session *session, enum_var_type type __attribute__((unused)),
908
LEX_STRING *base __attribute__((unused)))
881
unsigned char *value_ptr(Session *session, enum_var_type, LEX_STRING *)
910
883
return (*value_ptr_func)(session);
922
895
sys_var_have_option(sys_var_chain *chain, const char *variable_name):
923
896
sys_var(variable_name)
924
897
{ chain_sys_var(chain); }
925
unsigned char *value_ptr(Session *session __attribute__((unused)),
926
enum_var_type type __attribute__((unused)),
927
LEX_STRING *base __attribute__((unused)))
898
unsigned char *value_ptr(Session *, enum_var_type, LEX_STRING *)
929
900
return (unsigned char*) show_comp_option_name[get_option()];
931
bool update(Session *session __attribute__((unused)),
932
set_var *var __attribute__((unused))) { return 1; }
933
bool check_default(enum_var_type type __attribute__((unused)))
902
bool update(Session *, set_var *) { return 1; }
903
bool check_default(enum_var_type)
935
905
bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
936
bool check_update_type(Item_result type __attribute__((unused)))
906
bool check_update_type(Item_result)
938
908
SHOW_TYPE show_type() { return SHOW_CHAR; }
939
909
bool is_readonly() const { return 1; }
990
960
return type != STRING_RESULT; /* Only accept strings */
992
bool check_default(enum_var_type type __attribute__((unused)))
962
bool check_default(enum_var_type)
994
964
bool update(Session *session, set_var *var);
995
965
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);
1005
975
uint64_t SV::*offset_arg):
1006
976
sys_var_session(name_arg), offset(offset_arg)
1007
977
{ chain_sys_var(chain); }
1008
bool check(Session *session __attribute__((unused)),
1009
set_var *var __attribute__((unused))) {return 0;}
978
bool check(Session *, set_var *) {return 0;}
1010
979
bool update(Session *session, set_var *var);
1011
980
void set_default(Session *session, enum_var_type type);
1012
981
SHOW_TYPE show_type() { return SHOW_DOUBLE; }
1048
1017
return ((type != STRING_RESULT) && (type != INT_RESULT));
1050
bool check_default(enum_var_type type __attribute__((unused)))
1019
bool check_default(enum_var_type)
1052
1021
bool update(Session *session, set_var *var);
1053
1022
unsigned char *value_ptr(Session *session, enum_var_type type, LEX_STRING *base);