95
95
(binlog_status == SESSION_VARIABLE_IN_BINLOG);
97
97
virtual bool update(THD *thd, set_var *var)=0;
98
virtual void set_default(THD *thd_arg __attribute__((__unused__)),
99
enum_var_type type __attribute__((__unused__)))
98
virtual void set_default(THD *thd_arg __attribute__((unused)),
99
enum_var_type type __attribute__((unused)))
101
101
virtual SHOW_TYPE show_type() { return SHOW_UNDEF; }
102
virtual uchar *value_ptr(THD *thd __attribute__((__unused__)),
103
enum_var_type type __attribute__((__unused__)),
104
LEX_STRING *base __attribute__((__unused__)))
102
virtual uchar *value_ptr(THD *thd __attribute__((unused)),
103
enum_var_type type __attribute__((unused)),
104
LEX_STRING *base __attribute__((unused)))
106
106
virtual bool check_type(enum_var_type type)
107
107
{ return type != OPT_GLOBAL; } /* Error if not GLOBAL */
108
108
virtual bool check_update_type(Item_result type)
109
109
{ return type != INT_RESULT; } /* Assume INT */
110
virtual bool check_default(enum_var_type type __attribute__((__unused__)))
110
virtual bool check_default(enum_var_type type __attribute__((unused)))
111
111
{ return option_limits == 0; }
112
112
Item *item(THD *thd, enum_var_type type, LEX_STRING *base);
113
113
virtual bool is_struct() { return 0; }
163
163
bool update(THD *thd, set_var *var);
164
164
void set_default(THD *thd, enum_var_type type);
165
165
SHOW_TYPE show_type() { return SHOW_LONG; }
166
uchar *value_ptr(THD *thd __attribute__((__unused__)),
167
enum_var_type type __attribute__((__unused__)),
168
LEX_STRING *base __attribute__((__unused__)))
166
uchar *value_ptr(THD *thd __attribute__((unused)),
167
enum_var_type type __attribute__((unused)),
168
LEX_STRING *base __attribute__((unused)))
169
169
{ return (uchar*) value; }
196
196
bool update(THD *thd, set_var *var);
197
197
void set_default(THD *thd, enum_var_type type);
198
198
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
199
uchar *value_ptr(THD *thd __attribute__((__unused__)),
200
enum_var_type type __attribute__((__unused__)),
201
LEX_STRING *base __attribute__((__unused__)))
199
uchar *value_ptr(THD *thd __attribute__((unused)),
200
enum_var_type type __attribute__((unused)),
201
LEX_STRING *base __attribute__((unused)))
202
202
{ return (uchar*) value; }
217
217
bool update(THD *thd, set_var *var);
218
218
void set_default(THD *thd, enum_var_type type);
219
219
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
220
uchar *value_ptr(THD *thd __attribute__((__unused__)),
221
enum_var_type type __attribute__((__unused__)),
222
LEX_STRING *base __attribute__((__unused__)))
220
uchar *value_ptr(THD *thd __attribute__((unused)),
221
enum_var_type type __attribute__((unused)),
222
LEX_STRING *base __attribute__((unused)))
223
223
{ return (uchar*) value; }
224
bool check_update_type(Item_result type __attribute__((__unused__)))
224
bool check_update_type(Item_result type __attribute__((unused)))
262
262
(*set_default_func)(thd, type);
264
264
SHOW_TYPE show_type() { return SHOW_CHAR; }
265
uchar *value_ptr(THD *thd __attribute__((__unused__)),
266
enum_var_type type __attribute__((__unused__)),
267
LEX_STRING *base __attribute__((__unused__)))
265
uchar *value_ptr(THD *thd __attribute__((unused)),
266
enum_var_type type __attribute__((unused)),
267
LEX_STRING *base __attribute__((unused)))
268
268
{ return (uchar*) value; }
269
269
bool check_update_type(Item_result type)
271
271
return type != STRING_RESULT; /* Only accept strings */
273
bool check_default(enum_var_type type __attribute__((__unused__)))
273
bool check_default(enum_var_type type __attribute__((unused)))
288
288
value= new_value;
290
bool check(THD *thd __attribute__((__unused__)),
291
set_var *var __attribute__((__unused__)))
290
bool check(THD *thd __attribute__((unused)),
291
set_var *var __attribute__((unused)))
295
bool update(THD *thd __attribute__((__unused__)),
296
set_var *var __attribute__((__unused__)))
295
bool update(THD *thd __attribute__((unused)),
296
set_var *var __attribute__((unused)))
300
300
SHOW_TYPE show_type() { return SHOW_CHAR; }
301
uchar *value_ptr(THD *thd __attribute__((__unused__)),
302
enum_var_type type __attribute__((__unused__)),
303
LEX_STRING *base __attribute__((__unused__)))
301
uchar *value_ptr(THD *thd __attribute__((unused)),
302
enum_var_type type __attribute__((unused)),
303
LEX_STRING *base __attribute__((unused)))
305
305
return (uchar*) value;
307
bool check_update_type(Item_result type __attribute__((__unused__)))
307
bool check_update_type(Item_result type __attribute__((unused)))
311
bool check_default(enum_var_type type __attribute__((__unused__)))
311
bool check_default(enum_var_type type __attribute__((unused)))
313
313
bool is_readonly() const { return 1; }
321
321
sys_var_const_str_ptr(sys_var_chain *chain, const char *name_arg, char **value_arg)
322
322
:sys_var(name_arg),value(value_arg)
323
323
{ chain_sys_var(chain); }
324
bool check(THD *thd __attribute__((__unused__)),
325
set_var *var __attribute__((__unused__)))
324
bool check(THD *thd __attribute__((unused)),
325
set_var *var __attribute__((unused)))
329
bool update(THD *thd __attribute__((__unused__)),
330
set_var *var __attribute__((__unused__)))
329
bool update(THD *thd __attribute__((unused)),
330
set_var *var __attribute__((unused)))
334
334
SHOW_TYPE show_type() { return SHOW_CHAR; }
335
uchar *value_ptr(THD *thd __attribute__((__unused__)),
336
enum_var_type type __attribute__((__unused__)),
337
LEX_STRING *base __attribute__((__unused__)))
335
uchar *value_ptr(THD *thd __attribute__((unused)),
336
enum_var_type type __attribute__((unused)),
337
LEX_STRING *base __attribute__((unused)))
339
339
return (uchar*) *value;
341
bool check_update_type(Item_result type __attribute__((__unused__)))
341
bool check_update_type(Item_result type __attribute__((unused)))
345
bool check_default(enum_var_type type __attribute__((__unused__)))
345
bool check_default(enum_var_type type __attribute__((unused)))
347
347
bool is_readonly(void) const { return 1; }
364
364
bool update(THD *thd, set_var *var);
365
365
SHOW_TYPE show_type() { return SHOW_CHAR; }
366
366
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
367
bool check_update_type(Item_result type __attribute__((__unused__)))
367
bool check_update_type(Item_result type __attribute__((unused)))
378
378
TYPELIB *typelib, sys_after_update_func func)
379
379
:sys_var(name_arg,func), offset(offset_arg), enum_names(typelib)
380
380
{ chain_sys_var(chain); }
381
bool check(THD *thd __attribute__((__unused__)),
382
set_var *var __attribute__((__unused__)))
381
bool check(THD *thd __attribute__((unused)),
382
set_var *var __attribute__((unused)))
384
bool update(THD *thd __attribute__((__unused__)),
385
set_var *var __attribute__((__unused__)))
384
bool update(THD *thd __attribute__((unused)),
385
set_var *var __attribute__((unused)))
387
387
SHOW_TYPE show_type() { return SHOW_CHAR; }
388
bool check_update_type(Item_result type __attribute__((__unused__)))
388
bool check_update_type(Item_result type __attribute__((unused)))
390
390
bool is_readonly() const { return 1; }
391
391
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
400
400
Binlog_status_enum binlog_status= NOT_IN_BINLOG)
401
401
:sys_var(name_arg, func, binlog_status)
403
bool check_type(enum_var_type type __attribute__((__unused__)))
403
bool check_type(enum_var_type type __attribute__((unused)))
405
405
bool check_default(enum_var_type type)
530
530
void set_default(THD *thd, enum_var_type type);
531
531
SHOW_TYPE show_type() { return SHOW_CHAR; }
532
532
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
533
bool check_update_type(Item_result type __attribute__((__unused__)))
533
bool check_update_type(Item_result type __attribute__((unused)))
590
590
{ chain_sys_var(chain); }
591
591
bool check(THD *thd, set_var *var);
592
592
bool update(THD *thd, set_var *var);
593
bool check_update_type(Item_result type __attribute__((__unused__)))
593
bool check_update_type(Item_result type __attribute__((unused)))
595
595
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
596
596
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
609
609
bool update(THD *thd, set_var *var);
610
610
void set_default(THD *thd, enum_var_type type);
611
611
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
612
bool check_default(enum_var_type type __attribute__((__unused__)))
612
bool check_default(enum_var_type type __attribute__((unused)))
614
614
SHOW_TYPE show_type(void) { return SHOW_LONG; }
615
615
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
682
682
return ((type != STRING_RESULT) && (type != INT_RESULT));
684
bool check_default(enum_var_type type __attribute__((__unused__))) { return 0; }
684
bool check_default(enum_var_type type __attribute__((unused))) { return 0; }
685
685
virtual void set_default(THD *thd, enum_var_type type)= 0;
706
706
return ((type != STRING_RESULT) && (type != INT_RESULT));
708
bool check_default(enum_var_type type __attribute__((__unused__)))
708
bool check_default(enum_var_type type __attribute__((unused)))
710
710
bool update(THD *thd, set_var *var);
711
711
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
787
787
:sys_var(name_arg), offset(offset_arg)
788
788
{ chain_sys_var(chain); }
789
789
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
790
bool check_default(enum_var_type type __attribute__((__unused__)))
790
bool check_default(enum_var_type type __attribute__((unused)))
792
792
bool is_struct() { return 1; }
833
833
return type != STRING_RESULT; /* Only accept strings */
835
bool check_default(enum_var_type type __attribute__((__unused__)))
835
bool check_default(enum_var_type type __attribute__((unused)))
837
837
bool check(THD *thd, set_var *var);
838
838
bool update(THD *thd, set_var *var);
869
869
return check_set(thd, var, enum_names);
871
virtual void set_default(THD *thd __attribute__((__unused__)),
872
enum_var_type type __attribute__((__unused__)))
871
virtual void set_default(THD *thd __attribute__((unused)),
872
enum_var_type type __attribute__((unused)))
876
876
bool update(THD *thd, set_var *var);
877
877
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
878
bool check_update_type(Item_result type __attribute__((__unused__)))
878
bool check_update_type(Item_result type __attribute__((unused)))
880
880
SHOW_TYPE show_type() { return SHOW_CHAR; }
911
911
bool update(THD *thd, set_var *var);
912
912
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
913
bool check_update_type(Item_result type __attribute__((__unused__)))
913
bool check_update_type(Item_result type __attribute__((unused)))
915
915
void set_default(THD *thd, enum_var_type type);
916
916
SHOW_TYPE show_type() { return SHOW_CHAR; }
931
931
:sys_var(name_arg), var_type(type),
932
932
show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg)
933
933
{ chain_sys_var(chain); }
934
bool update(THD *thd __attribute__((__unused__)),
935
set_var *var __attribute__((__unused__)))
934
bool update(THD *thd __attribute__((unused)),
935
set_var *var __attribute__((unused)))
937
bool check_default(enum_var_type type __attribute__((__unused__)))
937
bool check_default(enum_var_type type __attribute__((unused)))
939
939
bool check_type(enum_var_type type) { return type != var_type; }
940
bool check_update_type(Item_result type __attribute__((__unused__)))
940
bool check_update_type(Item_result type __attribute__((unused)))
942
uchar *value_ptr(THD *thd, enum_var_type type __attribute__((__unused__)),
943
LEX_STRING *base __attribute__((__unused__)))
942
uchar *value_ptr(THD *thd, enum_var_type type __attribute__((unused)),
943
LEX_STRING *base __attribute__((unused)))
945
945
return (*value_ptr_func)(thd);
957
957
sys_var_have_option(sys_var_chain *chain, const char *variable_name):
958
958
sys_var(variable_name)
959
959
{ chain_sys_var(chain); }
960
uchar *value_ptr(THD *thd __attribute__((__unused__)),
961
enum_var_type type __attribute__((__unused__)),
962
LEX_STRING *base __attribute__((__unused__)))
960
uchar *value_ptr(THD *thd __attribute__((unused)),
961
enum_var_type type __attribute__((unused)),
962
LEX_STRING *base __attribute__((unused)))
964
964
return (uchar*) show_comp_option_name[get_option()];
966
bool update(THD *thd __attribute__((__unused__)),
967
set_var *var __attribute__((__unused__))) { return 1; }
968
bool check_default(enum_var_type type __attribute__((__unused__)))
966
bool update(THD *thd __attribute__((unused)),
967
set_var *var __attribute__((unused))) { return 1; }
968
bool check_default(enum_var_type type __attribute__((unused)))
970
970
bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
971
bool check_update_type(Item_result type __attribute__((__unused__)))
971
bool check_update_type(Item_result type __attribute__((unused)))
973
973
SHOW_TYPE show_type() { return SHOW_CHAR; }
974
974
bool is_readonly() const { return 1; }
1025
1025
return type != STRING_RESULT; /* Only accept strings */
1027
bool check_default(enum_var_type type __attribute__((__unused__)))
1027
bool check_default(enum_var_type type __attribute__((unused)))
1029
1029
bool update(THD *thd, set_var *var);
1030
1030
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
1058
1058
uint64_t SV::*offset_arg):
1059
1059
sys_var_thd(name_arg), offset(offset_arg)
1060
1060
{ chain_sys_var(chain); }
1061
bool check(THD *thd __attribute__((__unused__)),
1062
set_var *var __attribute__((__unused__))) {return 0;}
1061
bool check(THD *thd __attribute__((unused)),
1062
set_var *var __attribute__((unused))) {return 0;}
1063
1063
bool update(THD *thd, set_var *var);
1064
1064
void set_default(THD *thd, enum_var_type type);
1065
1065
SHOW_TYPE show_type() { return SHOW_DOUBLE; }
1104
1104
return ((type != STRING_RESULT) && (type != INT_RESULT));
1106
bool check_default(enum_var_type type __attribute__((__unused__)))
1106
bool check_default(enum_var_type type __attribute__((unused)))
1108
1108
bool update(THD *thd, set_var *var);
1109
1109
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);