1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
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.
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.
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
1
/* Copyright (C) 2002-2006 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
20
16
/* Classes to support the SET command */
18
#ifdef USE_PRAGMA_INTERFACE
19
#pragma interface /* gcc class implementation */
23
22
/****************************************************************************
24
23
Variables that are changable runtime are declared using the
96
95
(binlog_status == SESSION_VARIABLE_IN_BINLOG);
98
97
virtual bool update(THD *thd, set_var *var)=0;
99
virtual void set_default(THD *thd_arg __attribute__((unused)),
100
enum_var_type type __attribute__((unused)))
98
virtual void set_default(THD *thd_arg __attribute__((__unused__)),
99
enum_var_type type __attribute__((__unused__)))
102
101
virtual SHOW_TYPE show_type() { return SHOW_UNDEF; }
103
virtual unsigned char *value_ptr(THD *thd __attribute__((unused)),
104
enum_var_type type __attribute__((unused)),
105
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__)))
107
106
virtual bool check_type(enum_var_type type)
108
107
{ return type != OPT_GLOBAL; } /* Error if not GLOBAL */
109
108
virtual bool check_update_type(Item_result type)
110
109
{ return type != INT_RESULT; } /* Assume INT */
111
virtual bool check_default(enum_var_type type __attribute__((unused)))
110
virtual bool check_default(enum_var_type type __attribute__((__unused__)))
112
111
{ return option_limits == 0; }
113
112
Item *item(THD *thd, enum_var_type type, LEX_STRING *base);
114
113
virtual bool is_struct() { return 0; }
164
163
bool update(THD *thd, set_var *var);
165
164
void set_default(THD *thd, enum_var_type type);
166
165
SHOW_TYPE show_type() { return SHOW_LONG; }
167
unsigned char *value_ptr(THD *thd __attribute__((unused)),
168
enum_var_type type __attribute__((unused)),
169
LEX_STRING *base __attribute__((unused)))
170
{ return (unsigned char*) value; }
166
uchar *value_ptr(THD *thd __attribute__((__unused__)),
167
enum_var_type type __attribute__((__unused__)),
168
LEX_STRING *base __attribute__((__unused__)))
169
{ return (uchar*) value; }
197
196
bool update(THD *thd, set_var *var);
198
197
void set_default(THD *thd, enum_var_type type);
199
198
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
200
unsigned char *value_ptr(THD *thd __attribute__((unused)),
201
enum_var_type type __attribute__((unused)),
202
LEX_STRING *base __attribute__((unused)))
203
{ return (unsigned char*) value; }
199
uchar *value_ptr(THD *thd __attribute__((__unused__)),
200
enum_var_type type __attribute__((__unused__)),
201
LEX_STRING *base __attribute__((__unused__)))
202
{ return (uchar*) value; }
218
217
bool update(THD *thd, set_var *var);
219
218
void set_default(THD *thd, enum_var_type type);
220
219
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
221
unsigned char *value_ptr(THD *thd __attribute__((unused)),
222
enum_var_type type __attribute__((unused)),
223
LEX_STRING *base __attribute__((unused)))
224
{ return (unsigned char*) value; }
225
bool check_update_type(Item_result type __attribute__((unused)))
220
uchar *value_ptr(THD *thd __attribute__((__unused__)),
221
enum_var_type type __attribute__((__unused__)),
222
LEX_STRING *base __attribute__((__unused__)))
223
{ return (uchar*) value; }
224
bool check_update_type(Item_result type __attribute__((__unused__)))
263
262
(*set_default_func)(thd, type);
265
264
SHOW_TYPE show_type() { return SHOW_CHAR; }
266
unsigned char *value_ptr(THD *thd __attribute__((unused)),
267
enum_var_type type __attribute__((unused)),
268
LEX_STRING *base __attribute__((unused)))
269
{ return (unsigned char*) value; }
265
uchar *value_ptr(THD *thd __attribute__((__unused__)),
266
enum_var_type type __attribute__((__unused__)),
267
LEX_STRING *base __attribute__((__unused__)))
268
{ return (uchar*) value; }
270
269
bool check_update_type(Item_result type)
272
271
return type != STRING_RESULT; /* Only accept strings */
274
bool check_default(enum_var_type type __attribute__((unused)))
273
bool check_default(enum_var_type type __attribute__((__unused__)))
289
288
value= new_value;
291
bool check(THD *thd __attribute__((unused)),
292
set_var *var __attribute__((unused)))
290
bool check(THD *thd __attribute__((__unused__)),
291
set_var *var __attribute__((__unused__)))
296
bool update(THD *thd __attribute__((unused)),
297
set_var *var __attribute__((unused)))
295
bool update(THD *thd __attribute__((__unused__)),
296
set_var *var __attribute__((__unused__)))
301
300
SHOW_TYPE show_type() { return SHOW_CHAR; }
302
unsigned char *value_ptr(THD *thd __attribute__((unused)),
303
enum_var_type type __attribute__((unused)),
304
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__)))
306
return (unsigned char*) value;
305
return (uchar*) value;
308
bool check_update_type(Item_result type __attribute__((unused)))
307
bool check_update_type(Item_result type __attribute__((__unused__)))
312
bool check_default(enum_var_type type __attribute__((unused)))
311
bool check_default(enum_var_type type __attribute__((__unused__)))
314
313
bool is_readonly() const { return 1; }
322
321
sys_var_const_str_ptr(sys_var_chain *chain, const char *name_arg, char **value_arg)
323
322
:sys_var(name_arg),value(value_arg)
324
323
{ chain_sys_var(chain); }
325
bool check(THD *thd __attribute__((unused)),
326
set_var *var __attribute__((unused)))
324
bool check(THD *thd __attribute__((__unused__)),
325
set_var *var __attribute__((__unused__)))
330
bool update(THD *thd __attribute__((unused)),
331
set_var *var __attribute__((unused)))
329
bool update(THD *thd __attribute__((__unused__)),
330
set_var *var __attribute__((__unused__)))
335
334
SHOW_TYPE show_type() { return SHOW_CHAR; }
336
unsigned char *value_ptr(THD *thd __attribute__((unused)),
337
enum_var_type type __attribute__((unused)),
338
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__)))
340
return (unsigned char*) *value;
339
return (uchar*) *value;
342
bool check_update_type(Item_result type __attribute__((unused)))
341
bool check_update_type(Item_result type __attribute__((__unused__)))
346
bool check_default(enum_var_type type __attribute__((unused)))
345
bool check_default(enum_var_type type __attribute__((__unused__)))
348
347
bool is_readonly(void) const { return 1; }
352
351
class sys_var_enum :public sys_var
355
354
TYPELIB *enum_names;
357
sys_var_enum(sys_var_chain *chain, const char *name_arg, uint32_t *value_arg,
356
sys_var_enum(sys_var_chain *chain, const char *name_arg, uint *value_arg,
358
357
TYPELIB *typelib, sys_after_update_func func)
359
358
:sys_var(name_arg,func), value(value_arg), enum_names(typelib)
360
359
{ chain_sys_var(chain); }
379
378
TYPELIB *typelib, sys_after_update_func func)
380
379
:sys_var(name_arg,func), offset(offset_arg), enum_names(typelib)
381
380
{ chain_sys_var(chain); }
382
bool check(THD *thd __attribute__((unused)),
383
set_var *var __attribute__((unused)))
381
bool check(THD *thd __attribute__((__unused__)),
382
set_var *var __attribute__((__unused__)))
385
bool update(THD *thd __attribute__((unused)),
386
set_var *var __attribute__((unused)))
384
bool update(THD *thd __attribute__((__unused__)),
385
set_var *var __attribute__((__unused__)))
388
387
SHOW_TYPE show_type() { return SHOW_CHAR; }
389
bool check_update_type(Item_result type __attribute__((unused)))
388
bool check_update_type(Item_result type __attribute__((__unused__)))
391
390
bool is_readonly() const { return 1; }
392
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
391
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
469
468
bool update(THD *thd, set_var *var);
470
469
void set_default(THD *thd, enum_var_type type);
471
470
SHOW_TYPE show_type() { return SHOW_LONGLONG; }
472
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
471
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
473
472
bool check(THD *thd, set_var *var);
474
473
bool check_default(enum_var_type type)
485
484
class sys_var_thd_bool :public sys_var_thd
489
sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, bool SV::*offset_arg)
488
sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, my_bool SV::*offset_arg)
490
489
:sys_var_thd(name_arg), offset(offset_arg)
491
490
{ chain_sys_var(chain); }
492
sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, bool SV::*offset_arg,
491
sys_var_thd_bool(sys_var_chain *chain, const char *name_arg, my_bool SV::*offset_arg,
493
492
sys_after_update_func func)
494
493
:sys_var_thd(name_arg,func), offset(offset_arg)
495
494
{ chain_sys_var(chain); }
496
495
bool update(THD *thd, set_var *var);
497
496
void set_default(THD *thd, enum_var_type type);
498
497
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
499
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
498
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
500
499
bool check(THD *thd, set_var *var)
502
501
return check_enum(thd, var, &bool_typelib);
504
bool check_update_type(Item_result type __attribute__((unused)))
503
bool check_update_type(Item_result type __attribute__((__unused__)))
591
590
{ chain_sys_var(chain); }
592
591
bool check(THD *thd, set_var *var);
593
592
bool update(THD *thd, set_var *var);
594
bool check_update_type(Item_result type __attribute__((unused)))
593
bool check_update_type(Item_result type __attribute__((__unused__)))
596
595
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
597
596
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
598
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
597
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
601
600
/* some variables that require special handling */
610
609
bool update(THD *thd, set_var *var);
611
610
void set_default(THD *thd, enum_var_type type);
612
611
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
613
bool check_default(enum_var_type type __attribute__((unused)))
612
bool check_default(enum_var_type type __attribute__((__unused__)))
615
614
SHOW_TYPE show_type(void) { return SHOW_LONG; }
616
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
615
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
707
706
return ((type != STRING_RESULT) && (type != INT_RESULT));
709
bool check_default(enum_var_type type __attribute__((unused)))
708
bool check_default(enum_var_type type __attribute__((__unused__)))
711
710
bool update(THD *thd, set_var *var);
712
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
711
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
713
712
virtual void set_default(THD *thd, enum_var_type type)= 0;
714
virtual const CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type)= 0;
713
virtual CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type)= 0;
716
class sys_var_character_set_sv :public sys_var_character_set
718
CHARSET_INFO *SV::*offset;
719
CHARSET_INFO **global_default;
721
sys_var_character_set_sv(sys_var_chain *chain, const char *name_arg,
722
CHARSET_INFO *SV::*offset_arg,
723
CHARSET_INFO **global_default_arg,
725
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
726
: sys_var_character_set(name_arg, is_nullable, binlog_status_arg),
727
offset(offset_arg), global_default(global_default_arg)
728
{ chain_sys_var(chain); }
729
void set_default(THD *thd, enum_var_type type);
730
CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
734
class sys_var_character_set_client: public sys_var_character_set_sv
737
sys_var_character_set_client(sys_var_chain *chain, const char *name_arg,
738
CHARSET_INFO *SV::*offset_arg,
739
CHARSET_INFO **global_default_arg,
740
Binlog_status_enum binlog_status_arg)
741
: sys_var_character_set_sv(chain, name_arg, offset_arg, global_default_arg,
742
0, binlog_status_arg)
744
bool check(THD *thd, set_var *var);
748
class sys_var_character_set_database :public sys_var_character_set
751
sys_var_character_set_database(sys_var_chain *chain, const char *name_arg,
752
Binlog_status_enum binlog_status_arg=
754
: sys_var_character_set(name_arg, 0, binlog_status_arg)
755
{ chain_sys_var(chain); }
756
void set_default(THD *thd, enum_var_type type);
757
CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
717
760
class sys_var_collation_sv :public sys_var_collation
719
const CHARSET_INFO *SV::*offset;
720
const CHARSET_INFO **global_default;
762
CHARSET_INFO *SV::*offset;
763
CHARSET_INFO **global_default;
722
765
sys_var_collation_sv(sys_var_chain *chain, const char *name_arg,
723
const CHARSET_INFO *SV::*offset_arg,
724
const CHARSET_INFO **global_default_arg,
766
CHARSET_INFO *SV::*offset_arg,
767
CHARSET_INFO **global_default_arg,
725
768
Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
726
769
:sys_var_collation(name_arg, binlog_status_arg),
727
770
offset(offset_arg), global_default(global_default_arg)
776
819
class sys_var_thd_date_time_format :public sys_var_thd
778
821
DATE_TIME_FORMAT *SV::*offset;
779
enum enum_drizzle_timestamp_type date_time_type;
822
timestamp_type date_time_type;
781
824
sys_var_thd_date_time_format(sys_var_chain *chain, const char *name_arg,
782
825
DATE_TIME_FORMAT *SV::*offset_arg,
783
enum enum_drizzle_timestamp_type date_time_type_arg)
826
timestamp_type date_time_type_arg)
784
827
:sys_var_thd(name_arg), offset(offset_arg),
785
828
date_time_type(date_time_type_arg)
786
829
{ chain_sys_var(chain); }
790
833
return type != STRING_RESULT; /* Only accept strings */
792
bool check_default(enum_var_type type __attribute__((unused)))
835
bool check_default(enum_var_type type __attribute__((__unused__)))
794
837
bool check(THD *thd, set_var *var);
795
838
bool update(THD *thd, set_var *var);
796
839
void update2(THD *thd, enum_var_type type, DATE_TIME_FORMAT *new_value);
797
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
840
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
798
841
void set_default(THD *thd, enum_var_type type);
802
845
class sys_var_log_state :public sys_var_bool_ptr
806
849
sys_var_log_state(sys_var_chain *chain, const char *name_arg, bool *value_arg,
807
uint32_t log_type_arg)
808
851
:sys_var_bool_ptr(chain, name_arg, value_arg), log_type(log_type_arg) {}
809
852
bool update(THD *thd, set_var *var);
810
853
void set_default(THD *thd, enum_var_type type);
826
869
return check_set(thd, var, enum_names);
828
virtual void set_default(THD *thd __attribute__((unused)),
829
enum_var_type type __attribute__((unused)))
871
virtual void set_default(THD *thd __attribute__((__unused__)),
872
enum_var_type type __attribute__((__unused__)))
833
876
bool update(THD *thd, set_var *var);
834
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
835
bool check_update_type(Item_result type __attribute__((unused)))
877
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
878
bool check_update_type(Item_result type __attribute__((__unused__)))
837
880
SHOW_TYPE show_type() { return SHOW_CHAR; }
866
909
return check_set(thd, var, enum_names);
868
911
bool update(THD *thd, set_var *var);
869
unsigned char *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
870
bool check_update_type(Item_result type __attribute__((unused)))
912
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
913
bool check_update_type(Item_result type __attribute__((__unused__)))
872
915
void set_default(THD *thd, enum_var_type type);
873
916
SHOW_TYPE show_type() { return SHOW_CHAR; }
888
931
:sys_var(name_arg), var_type(type),
889
932
show_type_value(show_type_arg), value_ptr_func(value_ptr_func_arg)
890
933
{ chain_sys_var(chain); }
891
bool update(THD *thd __attribute__((unused)),
892
set_var *var __attribute__((unused)))
934
bool update(THD *thd __attribute__((__unused__)),
935
set_var *var __attribute__((__unused__)))
894
bool check_default(enum_var_type type __attribute__((unused)))
937
bool check_default(enum_var_type type __attribute__((__unused__)))
896
939
bool check_type(enum_var_type type) { return type != var_type; }
897
bool check_update_type(Item_result type __attribute__((unused)))
940
bool check_update_type(Item_result type __attribute__((__unused__)))
899
unsigned char *value_ptr(THD *thd, enum_var_type type __attribute__((unused)),
900
LEX_STRING *base __attribute__((unused)))
942
uchar *value_ptr(THD *thd, enum_var_type type __attribute__((__unused__)),
943
LEX_STRING *base __attribute__((__unused__)))
902
945
return (*value_ptr_func)(thd);
914
957
sys_var_have_option(sys_var_chain *chain, const char *variable_name):
915
958
sys_var(variable_name)
916
959
{ chain_sys_var(chain); }
917
unsigned char *value_ptr(THD *thd __attribute__((unused)),
918
enum_var_type type __attribute__((unused)),
919
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__)))
921
return (unsigned char*) show_comp_option_name[get_option()];
964
return (uchar*) show_comp_option_name[get_option()];
923
bool update(THD *thd __attribute__((unused)),
924
set_var *var __attribute__((unused))) { return 1; }
925
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__)))
927
970
bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
928
bool check_update_type(Item_result type __attribute__((unused)))
971
bool check_update_type(Item_result type __attribute__((__unused__)))
930
973
SHOW_TYPE show_type() { return SHOW_CHAR; }
931
974
bool is_readonly() const { return 1; }
949
992
class sys_var_have_plugin: public sys_var_have_option
951
994
const char *plugin_name_str;
952
const uint32_t plugin_name_len;
995
const uint plugin_name_len;
953
996
const int plugin_type;
956
999
sys_var_have_plugin(sys_var_chain *chain, const char *variable_name,
957
const char *plugin_name_str_arg, uint32_t plugin_name_len_arg,
1000
const char *plugin_name_str_arg, uint plugin_name_len_arg,
958
1001
int plugin_type_arg):
959
1002
sys_var_have_option(chain, variable_name),
960
1003
plugin_name_str(plugin_name_str_arg), plugin_name_len(plugin_name_len_arg),
1015
1058
uint64_t SV::*offset_arg):
1016
1059
sys_var_thd(name_arg), offset(offset_arg)
1017
1060
{ chain_sys_var(chain); }
1018
bool check(THD *thd __attribute__((unused)),
1019
set_var *var __attribute__((unused))) {return 0;}
1061
bool check(THD *thd __attribute__((__unused__)),
1062
set_var *var __attribute__((__unused__))) {return 0;}
1020
1063
bool update(THD *thd, set_var *var);
1021
1064
void set_default(THD *thd, enum_var_type type);
1022
1065
SHOW_TYPE show_type() { return SHOW_DOUBLE; }
1161
1204
class set_var_collation_client: public set_var_base
1163
const CHARSET_INFO *character_set_client;
1164
const CHARSET_INFO *character_set_results;
1165
const CHARSET_INFO *collation_connection;
1206
CHARSET_INFO *character_set_client;
1207
CHARSET_INFO *character_set_results;
1208
CHARSET_INFO *collation_connection;
1167
set_var_collation_client(const CHARSET_INFO * const client_coll_arg,
1168
const CHARSET_INFO * const connection_coll_arg,
1169
const CHARSET_INFO * const result_coll_arg)
1210
set_var_collation_client(CHARSET_INFO *client_coll_arg,
1211
CHARSET_INFO *connection_coll_arg,
1212
CHARSET_INFO *result_coll_arg)
1170
1213
:character_set_client(client_coll_arg),
1171
1214
character_set_results(result_coll_arg),
1172
1215
collation_connection(connection_coll_arg)
1186
1229
class NAMED_LIST :public ilink
1188
1231
const char *name;
1189
uint32_t name_length;
1191
unsigned char* data;
1193
1236
NAMED_LIST(I_List<NAMED_LIST> *links, const char *name_arg,
1194
uint32_t name_length_arg, unsigned char* data_arg)
1237
uint name_length_arg, uchar* data_arg)
1195
1238
:name_length(name_length_arg), data(data_arg)
1197
1240
name= my_strndup(name_arg, name_length, MYF(MY_WME));
1198
1241
links->push_back(this);
1200
inline bool cmp(const char *name_cmp, uint32_t length)
1243
inline bool cmp(const char *name_cmp, uint length)
1202
1245
return length == name_length && !memcmp(name, name_cmp, length);
1206
free((unsigned char*) name);
1249
my_free((uchar*) name, MYF(0));
1208
1251
friend bool process_key_caches(process_key_cache_t func);
1209
1252
friend void delete_elements(I_List<NAMED_LIST> *list,
1210
void (*free_element)(const char*, unsigned char*));
1253
void (*free_element)(const char*, uchar*));
1213
1256
/* updated in sql_acl.cc */
1229
1272
int set_var_init();
1230
1273
void set_var_free();
1231
int mysql_append_static_vars(const SHOW_VAR *show_vars, uint32_t count);
1274
int mysql_append_static_vars(const SHOW_VAR *show_vars, uint count);
1232
1275
SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted);
1233
1276
int mysql_add_sys_var_chain(sys_var *chain, struct my_option *long_options);
1234
1277
int mysql_del_sys_var_chain(sys_var *chain);
1235
sys_var *find_sys_var(THD *thd, const char *str, uint32_t length=0);
1278
sys_var *find_sys_var(THD *thd, const char *str, uint length=0);
1236
1279
int sql_set_variables(THD *thd, List<set_var_base> *var_list);
1237
1280
bool not_all_support_one_shot(List<set_var_base> *var_list);
1238
1281
void fix_delay_key_write(THD *thd, enum_var_type type);
1239
1282
void fix_slave_exec_mode(enum_var_type type);
1283
ulong fix_sql_mode(ulong sql_mode);
1284
extern sys_var_const_str sys_charset_system;
1240
1285
extern sys_var_str sys_init_connect;
1241
1286
extern sys_var_str sys_init_slave;
1242
1287
extern sys_var_thd_time_zone sys_time_zone;
1243
1288
extern sys_var_thd_bit sys_autocommit;
1244
const CHARSET_INFO *get_old_charset_by_name(const char *old_name);
1245
unsigned char* find_named(I_List<NAMED_LIST> *list, const char *name, uint32_t length,
1289
CHARSET_INFO *get_old_charset_by_name(const char *old_name);
1290
uchar* find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
1246
1291
NAMED_LIST **found);
1248
1293
extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path;
1250
1295
/* key_cache functions */
1251
1296
KEY_CACHE *get_key_cache(LEX_STRING *cache_name);
1252
KEY_CACHE *get_or_create_key_cache(const char *name, uint32_t length);
1297
KEY_CACHE *get_or_create_key_cache(const char *name, uint length);
1253
1298
void free_key_cache(const char *name, KEY_CACHE *key_cache);
1254
1299
bool process_key_caches(process_key_cache_t func);
1255
1300
void delete_elements(I_List<NAMED_LIST> *list,
1256
void (*free_element)(const char*, unsigned char*));
1301
void (*free_element)(const char*, uchar*));