46
46
them you must first assign a value to them (in specific ::check() for
49
#include <drizzled/server_includes.h>
50
#ifdef USE_PRAGMA_IMPLEMENTATION
51
#pragma implementation // gcc: Class implementation
54
#include "mysql_priv.h"
50
56
#include "rpl_mi.h"
51
#include <mysys/my_getopt.h>
52
#include <mysys/thr_alarm.h>
53
#include <storage/myisam/myisam.h>
54
#include <drizzled/drizzled_error_messages.h>
55
#include <libdrizzle/gettext.h>
57
#include <my_getopt.h>
58
#include <thr_alarm.h>
57
extern const CHARSET_INFO *character_set_filesystem;
62
extern CHARSET_INFO *character_set_filesystem;
60
65
static DYNAMIC_ARRAY fixed_show_vars;
61
66
static HASH system_variable_hash;
63
const char *bool_type_names[]= { "OFF", "ON", NULL };
68
const char *bool_type_names[]= { "OFF", "ON", NullS };
64
69
TYPELIB bool_typelib=
66
71
array_elements(bool_type_names)-1, "", bool_type_names, NULL
69
const char *delay_key_write_type_names[]= { "OFF", "ON", "ALL", NULL };
74
const char *delay_key_write_type_names[]= { "OFF", "ON", "ALL", NullS };
70
75
TYPELIB delay_key_write_typelib=
72
77
array_elements(delay_key_write_type_names)-1, "",
76
81
const char *slave_exec_mode_names[]=
77
{ "STRICT", "IDEMPOTENT", NULL };
82
{ "STRICT", "IDEMPOTENT", NullS };
78
83
static const unsigned int slave_exec_mode_names_len[]=
79
84
{ sizeof("STRICT") - 1, sizeof("IDEMPOTENT") - 1, 0 };
80
85
TYPELIB slave_exec_mode_typelib=
90
95
static bool set_option_bit(THD *thd, set_var *var);
91
96
static bool set_option_autocommit(THD *thd, set_var *var);
92
97
static int check_log_update(THD *thd, set_var *var);
98
static bool set_log_update(THD *thd, set_var *var);
93
99
static int check_pseudo_thread_id(THD *thd, set_var *var);
94
100
static void fix_low_priority_updates(THD *thd, enum_var_type type);
95
101
static int check_tx_isolation(THD *thd, set_var *var);
111
117
static bool get_unsigned(THD *thd, set_var *var);
112
118
bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
113
119
const char *name, int64_t val);
114
static KEY_CACHE *create_key_cache(const char *name, uint32_t length);
115
static unsigned char *get_error_count(THD *thd);
116
static unsigned char *get_warning_count(THD *thd);
117
static unsigned char *get_tmpdir(THD *thd);
120
static KEY_CACHE *create_key_cache(const char *name, uint length);
121
static uchar *get_error_count(THD *thd);
122
static uchar *get_warning_count(THD *thd);
123
static uchar *get_tmpdir(THD *thd);
124
static int sys_check_log_path(THD *thd, set_var *var);
125
static bool sys_update_general_log_path(THD *thd, set_var * var);
126
static void sys_default_general_log_path(THD *thd, enum_var_type type);
127
static bool sys_update_slow_log_path(THD *thd, set_var * var);
128
static void sys_default_slow_log_path(THD *thd, enum_var_type type);
120
131
Variable definition list
185
196
sys_collation_server(&vars, "collation_server", &SV::collation_server,
186
197
&default_charset_info,
187
198
sys_var::SESSION_VARIABLE_IN_BINLOG);
199
static sys_var_long_ptr sys_concurrent_insert(&vars, "concurrent_insert",
200
&myisam_concurrent_insert);
188
201
static sys_var_long_ptr sys_connect_timeout(&vars, "connect_timeout",
189
202
&connect_timeout);
190
203
static sys_var_const_str sys_datadir(&vars, "datadir", mysql_real_data_home);
196
209
static sys_var_long_ptr sys_expire_logs_days(&vars, "expire_logs_days",
197
210
&expire_logs_days);
198
211
static sys_var_bool_ptr sys_flush(&vars, "flush", &myisam_flush);
212
static sys_var_long_ptr sys_flush_time(&vars, "flush_time", &flush_time);
199
213
sys_var_str sys_init_connect(&vars, "init_connect", 0,
200
214
sys_update_init_connect,
201
215
sys_default_init_connect,0);
218
232
param_age_threshold));
219
233
static sys_var_bool_ptr sys_local_infile(&vars, "local_infile",
220
234
&opt_local_infile);
235
static sys_var_bool_ptr
236
sys_log_queries_not_using_indexes(&vars, "log_queries_not_using_indexes",
237
&opt_log_queries_not_using_indexes);
238
static sys_var_thd_ulong sys_log_warnings(&vars, "log_warnings", &SV::log_warnings);
239
static sys_var_microseconds sys_var_long_query_time(&vars, "long_query_time",
240
&SV::long_query_time);
221
241
static sys_var_thd_bool sys_low_priority_updates(&vars, "low_priority_updates",
222
242
&SV::low_priority_updates,
223
243
fix_low_priority_updates);
265
290
&max_write_lock_count);
266
291
static sys_var_thd_ulong sys_min_examined_row_limit(&vars, "min_examined_row_limit",
267
292
&SV::min_examined_row_limit);
293
static sys_var_long_ptr sys_myisam_data_pointer_size(&vars, "myisam_data_pointer_size",
294
&myisam_data_pointer_size);
268
295
static sys_var_thd_uint64_t sys_myisam_max_sort_file_size(&vars, "myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
269
296
static sys_var_thd_ulong sys_myisam_repair_threads(&vars, "myisam_repair_threads", &SV::myisam_repair_threads);
270
297
static sys_var_thd_ulong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
295
322
static sys_var_thd_ulong sys_optimizer_search_depth(&vars, "optimizer_search_depth",
296
323
&SV::optimizer_search_depth);
298
const char *optimizer_use_mrr_names[] = {"auto", "force", "disable", NULL};
325
const char *optimizer_use_mrr_names[] = {"auto", "force", "disable", NullS};
299
326
TYPELIB optimizer_use_mrr_typelib= {
300
327
array_elements(optimizer_use_mrr_names) - 1, "",
301
328
optimizer_use_mrr_names, NULL
340
367
static sys_var_long_ptr sys_server_id(&vars, "server_id", &server_id, fix_server_id);
341
368
static sys_var_bool_ptr sys_slave_compressed_protocol(&vars, "slave_compressed_protocol",
342
369
&opt_slave_compressed_protocol);
370
#ifdef HAVE_REPLICATION
343
371
static sys_var_bool_ptr sys_slave_allow_batching(&vars, "slave_allow_batching",
344
372
&slave_allow_batching);
345
373
static sys_var_set_slave_mode slave_exec_mode(&vars,
360
389
static sys_var_thd_optimizer_switch sys_optimizer_switch(&vars, "optimizer_switch",
361
390
&SV::optimizer_switch);
391
static sys_var_const_str sys_ssl_ca(&vars, "ssl_ca", NULL);
392
static sys_var_const_str sys_ssl_capath(&vars, "ssl_capath", NULL);
393
static sys_var_const_str sys_ssl_cert(&vars, "ssl_cert", NULL);
394
static sys_var_const_str sys_ssl_cipher(&vars, "ssl_cipher", NULL);
395
static sys_var_const_str sys_ssl_key(&vars, "ssl_key", NULL);
363
397
static sys_var_thd_storage_engine sys_storage_engine(&vars, "storage_engine",
364
398
&SV::table_plugin);
399
static sys_var_bool_ptr sys_sync_frm(&vars, "sync_frm", &opt_sync_frm);
365
400
static sys_var_const_str sys_system_time_zone(&vars, "system_time_zone",
366
401
system_time_zone);
367
402
static sys_var_long_ptr sys_table_def_size(&vars, "table_definition_cache",
384
419
static sys_var_bool_ptr sys_timed_mutexes(&vars, "timed_mutexes", &timed_mutexes);
385
420
static sys_var_const_str sys_version(&vars, "version", server_version);
386
421
static sys_var_const_str sys_version_comment(&vars, "version_comment",
387
DRIZZLE_COMPILATION_COMMENT);
422
MYSQL_COMPILATION_COMMENT);
388
423
static sys_var_const_str sys_version_compile_machine(&vars, "version_compile_machine",
390
425
static sys_var_const_str sys_version_compile_os(&vars, "version_compile_os",
402
437
static sys_var_thd_date_time_format sys_time_format(&vars, "time_format",
403
438
&SV::time_format,
404
DRIZZLE_TIMESTAMP_TIME);
439
MYSQL_TIMESTAMP_TIME);
405
440
static sys_var_thd_date_time_format sys_date_format(&vars, "date_format",
406
441
&SV::date_format,
407
DRIZZLE_TIMESTAMP_DATE);
442
MYSQL_TIMESTAMP_DATE);
408
443
static sys_var_thd_date_time_format sys_datetime_format(&vars, "datetime_format",
409
444
&SV::datetime_format,
410
DRIZZLE_TIMESTAMP_DATETIME);
445
MYSQL_TIMESTAMP_DATETIME);
412
447
/* Variables that are bits in THD */
523
570
static sys_var_const_str_ptr sys_repl_report_user(&vars, "report_user", &report_user);
524
571
static sys_var_const_str_ptr sys_repl_report_password(&vars, "report_password", &report_password);
526
static unsigned char *slave_get_report_port(THD *thd)
573
static uchar *slave_get_report_port(THD *thd)
528
575
thd->sys_var_tmp.long_value= report_port;
529
return (unsigned char*) &thd->sys_var_tmp.long_value;
576
return (uchar*) &thd->sys_var_tmp.long_value;
532
579
static sys_var_readonly sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_INT, slave_get_report_port);
536
583
/* Read only variables */
538
585
static sys_var_have_variable sys_have_compress(&vars, "have_compress", &have_compress);
586
static sys_var_have_variable sys_have_crypt(&vars, "have_crypt", &have_crypt);
587
static sys_var_have_plugin sys_have_csv(&vars, "have_csv", C_STRING_WITH_LEN("csv"), MYSQL_STORAGE_ENGINE_PLUGIN);
588
static sys_var_have_variable sys_have_dlopen(&vars, "have_dynamic_loading", &have_dlopen);
589
static sys_var_have_plugin sys_have_innodb(&vars, "have_innodb", C_STRING_WITH_LEN("innodb"), MYSQL_STORAGE_ENGINE_PLUGIN);
539
590
static sys_var_have_variable sys_have_symlink(&vars, "have_symlink", &have_symlink);
591
/* Global read-only variable describing server license */
592
static sys_var_const_str sys_license(&vars, "license", STRINGIFY_ARG(LICENSE));
593
/* Global variables which enable|disable logging */
594
static sys_var_log_state sys_var_general_log(&vars, "general_log", &opt_log,
596
/* Synonym of "general_log" for consistency with SHOW VARIABLES output */
597
static sys_var_log_state sys_var_log(&vars, "log", &opt_log, QUERY_LOG_GENERAL);
598
static sys_var_log_state sys_var_slow_query_log(&vars, "slow_query_log", &opt_slow_log,
600
/* Synonym of "slow_query_log" for consistency with SHOW VARIABLES output */
601
static sys_var_log_state sys_var_log_slow(&vars, "log_slow_queries",
602
&opt_slow_log, QUERY_LOG_SLOW);
603
sys_var_str sys_var_general_log_path(&vars, "general_log_file", sys_check_log_path,
604
sys_update_general_log_path,
605
sys_default_general_log_path,
607
sys_var_str sys_var_slow_log_path(&vars, "slow_query_log_file", sys_check_log_path,
608
sys_update_slow_log_path,
609
sys_default_slow_log_path,
611
static sys_var_log_output sys_var_log_output_state(&vars, "log_output", &log_output_options,
612
&log_output_typelib, 0);
541
616
Additional variables (not derived from sys_var class, not accessible as
542
617
@@varname in SELECT or SET). Sorted in alphabetical order to facilitate
547
622
#define FIXED_VARS_SIZE (sizeof(fixed_vars) / sizeof(SHOW_VAR))
548
623
static SHOW_VAR fixed_vars[]= {
549
624
{"back_log", (char*) &back_log, SHOW_LONG},
625
{"character_sets_dir", mysql_charsets_dir, SHOW_CHAR},
550
626
{"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR},
551
627
{"language", language, SHOW_CHAR},
552
628
#ifdef HAVE_MLOCKALL
555
631
{"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
556
632
{"log_error", (char*) log_error_file, SHOW_CHAR},
633
{"lower_case_file_system", (char*) &lower_case_file_system, SHOW_MY_BOOL},
634
{"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT},
557
635
{"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR},
558
636
{"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
559
637
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
560
638
{"plugin_dir", (char*) opt_plugin_dir, SHOW_CHAR},
561
639
{"port", (char*) &mysqld_port, SHOW_INT},
562
640
{"protocol_version", (char*) &protocol_version, SHOW_INT},
641
{"skip_external_locking", (char*) &my_disable_locking, SHOW_MY_BOOL},
642
{"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL},
643
{"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
563
644
{"thread_stack", (char*) &my_thread_stack_size, SHOW_LONG},
567
bool sys_var::check(THD *thd __attribute__((unused)), set_var *var)
648
bool sys_var::check(THD *thd __attribute__((__unused__)), set_var *var)
569
650
var->save_result.uint64_t_value= var->value->val_int();
613
694
var_str->value= res;
614
695
var_str->value_length= new_length;
615
696
rw_unlock(var_mutex);
697
my_free(old_value, MYF(MY_ALLOW_ZERO_PTR));
621
static bool sys_update_init_connect(THD *thd __attribute__((unused)), set_var *var)
702
static bool sys_update_init_connect(THD *thd __attribute__((__unused__)), set_var *var)
623
704
return update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, var);
627
static void sys_default_init_connect(THD* thd __attribute__((unused)),
628
enum_var_type type __attribute__((unused)))
708
static void sys_default_init_connect(THD* thd __attribute__((__unused__)),
709
enum_var_type type __attribute__((__unused__)))
630
711
update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, 0);
634
static bool sys_update_init_slave(THD *thd __attribute__((unused)),
715
static bool sys_update_init_slave(THD *thd __attribute__((__unused__)),
637
718
return update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, var);
641
static void sys_default_init_slave(THD* thd __attribute__((unused)),
642
enum_var_type type __attribute__((unused)))
722
static void sys_default_init_slave(THD* thd __attribute__((__unused__)),
723
enum_var_type type __attribute__((__unused__)))
644
725
update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0);
750
832
if (type != OPT_GLOBAL)
751
833
thd->net.retry_count=thd->variables.net_retry_count;
755
extern void fix_delay_key_write(THD *thd __attribute__((unused)),
756
enum_var_type type __attribute__((unused)))
835
#else /* HAVE_REPLICATION */
836
static void fix_net_read_timeout(THD *thd __attribute__((unused)),
837
enum_var_type type __attribute__((unused)))
839
static void fix_net_write_timeout(THD *thd __attribute__((unused)),
840
enum_var_type type __attribute__((unused)))
842
static void fix_net_retry_count(THD *thd __attribute__((unused)),
843
enum_var_type type __attribute__((unused)))
845
#endif /* HAVE_REPLICATION */
848
extern void fix_delay_key_write(THD *thd __attribute__((__unused__)),
849
enum_var_type type __attribute__((__unused__)))
758
851
switch ((enum_delay_key_write) delay_key_write_options) {
759
852
case DELAY_KEY_WRITE_NONE:
772
bool sys_var_set::update(THD *thd __attribute__((unused)),
865
bool sys_var_set::update(THD *thd __attribute__((__unused__)),
775
868
*value= var->save_result.ulong_value;
779
unsigned char *sys_var_set::value_ptr(THD *thd,
780
enum_var_type type __attribute__((unused)),
781
LEX_STRING *base __attribute__((unused)))
872
uchar *sys_var_set::value_ptr(THD *thd,
873
enum_var_type type __attribute__((__unused__)),
874
LEX_STRING *base __attribute__((__unused__)))
784
String tmp(buff, sizeof(buff), &my_charset_utf8_general_ci);
877
String tmp(buff, sizeof(buff), &my_charset_latin1);
786
879
ulong val= *value;
789
for (uint32_t i= 0; val; val>>= 1, i++)
882
for (uint i= 0; val; val>>= 1, i++)
799
892
if ((length= tmp.length()))
801
return (unsigned char*) thd->strmake(tmp.ptr(), length);
894
return (uchar*) thd->strmake(tmp.ptr(), length);
804
void sys_var_set_slave_mode::set_default(THD *thd __attribute__((unused)),
805
enum_var_type type __attribute__((unused)))
897
void sys_var_set_slave_mode::set_default(THD *thd __attribute__((__unused__)),
898
enum_var_type type __attribute__((__unused__)))
807
900
slave_exec_mode_options= 0;
808
901
bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
833
void fix_slave_exec_mode(enum_var_type type __attribute__((unused)))
926
void fix_slave_exec_mode(enum_var_type type __attribute__((__unused__)))
835
928
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
836
929
bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
838
sql_print_error(_("Ambiguous slave modes combination."
839
" STRICT will be used"));
931
sql_print_error("Ambiguous slave modes combination."
932
" STRICT will be used");
840
933
bit_do_clear(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT);
842
935
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 0)
881
974
void fix_binlog_format_after_update(THD *thd,
882
enum_var_type type __attribute__((unused)))
975
enum_var_type type __attribute__((__unused__)))
884
977
thd->reset_current_stmt_binlog_row_based();
888
static void fix_max_binlog_size(THD *thd __attribute__((unused)),
889
enum_var_type type __attribute__((unused)))
981
static void fix_max_binlog_size(THD *thd __attribute__((__unused__)),
982
enum_var_type type __attribute__((__unused__)))
891
984
mysql_bin_log.set_max_size(max_binlog_size);
985
#ifdef HAVE_REPLICATION
892
986
if (!max_relay_log_size)
893
987
active_mi->rli.relay_log.set_max_size(max_binlog_size);
897
static void fix_max_relay_log_size(THD *thd __attribute__((unused)),
898
enum_var_type type __attribute__((unused)))
992
static void fix_max_relay_log_size(THD *thd __attribute__((__unused__)),
993
enum_var_type type __attribute__((__unused__)))
995
#ifdef HAVE_REPLICATION
900
996
active_mi->rli.relay_log.set_max_size(max_relay_log_size ?
901
997
max_relay_log_size: max_binlog_size);
905
static void fix_max_connections(THD *thd __attribute__((unused)),
906
enum_var_type type __attribute__((unused)))
1002
static void fix_max_connections(THD *thd __attribute__((__unused__)),
1003
enum_var_type type __attribute__((__unused__)))
908
1005
resize_thr_alarm(max_connections + 10);
1052
bool sys_var_bool_ptr::update(THD *thd __attribute__((unused)), set_var *var)
1149
bool sys_var_bool_ptr::update(THD *thd __attribute__((__unused__)), set_var *var)
1054
1151
*value= (bool) var->save_result.ulong_value;
1059
void sys_var_bool_ptr::set_default(THD *thd __attribute__((unused)), enum_var_type type __attribute__((unused)))
1156
void sys_var_bool_ptr::set_default(THD *thd __attribute__((__unused__)), enum_var_type type __attribute__((__unused__)))
1061
1158
*value= (bool) option_limits->def_value;
1065
bool sys_var_enum::update(THD *thd __attribute__((unused)), set_var *var)
1162
bool sys_var_enum::update(THD *thd __attribute__((__unused__)), set_var *var)
1067
1164
*value= (uint) var->save_result.ulong_value;
1072
unsigned char *sys_var_enum::value_ptr(THD *thd __attribute__((unused)),
1073
enum_var_type type __attribute__((unused)),
1074
LEX_STRING *base __attribute__((unused)))
1169
uchar *sys_var_enum::value_ptr(THD *thd __attribute__((__unused__)),
1170
enum_var_type type __attribute__((__unused__)),
1171
LEX_STRING *base __attribute__((__unused__)))
1076
return (unsigned char*) enum_names->type_names[*value];
1173
return (uchar*) enum_names->type_names[*value];
1080
unsigned char *sys_var_enum_const::value_ptr(THD *thd __attribute__((unused)),
1081
enum_var_type type __attribute__((unused)),
1082
LEX_STRING *base __attribute__((unused)))
1177
uchar *sys_var_enum_const::value_ptr(THD *thd __attribute__((__unused__)),
1178
enum_var_type type __attribute__((__unused__)),
1179
LEX_STRING *base __attribute__((__unused__)))
1084
return (unsigned char*) enum_names->type_names[global_system_variables.*offset];
1181
return (uchar*) enum_names->type_names[global_system_variables.*offset];
1087
1184
bool sys_var_thd_ulong::check(THD *thd, set_var *var)
1138
unsigned char *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
1139
LEX_STRING *base __attribute__((unused)))
1235
uchar *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
1236
LEX_STRING *base __attribute__((__unused__)))
1141
1238
if (type == OPT_GLOBAL)
1142
return (unsigned char*) &(global_system_variables.*offset);
1143
return (unsigned char*) &(thd->variables.*offset);
1239
return (uchar*) &(global_system_variables.*offset);
1240
return (uchar*) &(thd->variables.*offset);
1187
unsigned char *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
1188
LEX_STRING *base __attribute__((unused)))
1284
uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
1285
LEX_STRING *base __attribute__((__unused__)))
1190
1287
if (type == OPT_GLOBAL)
1191
return (unsigned char*) &(global_system_variables.*offset);
1192
return (unsigned char*) &(thd->variables.*offset);
1288
return (uchar*) &(global_system_variables.*offset);
1289
return (uchar*) &(thd->variables.*offset);
1195
1292
bool sys_var_thd_uint64_t::check(THD *thd, set_var *var)
1238
unsigned char *sys_var_thd_uint64_t::value_ptr(THD *thd, enum_var_type type,
1239
LEX_STRING *base __attribute__((unused)))
1335
uchar *sys_var_thd_uint64_t::value_ptr(THD *thd, enum_var_type type,
1336
LEX_STRING *base __attribute__((__unused__)))
1241
1338
if (type == OPT_GLOBAL)
1242
return (unsigned char*) &(global_system_variables.*offset);
1243
return (unsigned char*) &(thd->variables.*offset);
1339
return (uchar*) &(global_system_variables.*offset);
1340
return (uchar*) &(thd->variables.*offset);
1247
1344
bool sys_var_thd_bool::update(THD *thd, set_var *var)
1249
1346
if (var->type == OPT_GLOBAL)
1250
global_system_variables.*offset= (bool) var->save_result.ulong_value;
1347
global_system_variables.*offset= (my_bool) var->save_result.ulong_value;
1252
thd->variables.*offset= (bool) var->save_result.ulong_value;
1349
thd->variables.*offset= (my_bool) var->save_result.ulong_value;
1257
1354
void sys_var_thd_bool::set_default(THD *thd, enum_var_type type)
1259
1356
if (type == OPT_GLOBAL)
1260
global_system_variables.*offset= (bool) option_limits->def_value;
1357
global_system_variables.*offset= (my_bool) option_limits->def_value;
1262
1359
thd->variables.*offset= global_system_variables.*offset;
1266
unsigned char *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
1267
LEX_STRING *base __attribute__((unused)))
1363
uchar *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
1364
LEX_STRING *base __attribute__((__unused__)))
1269
1366
if (type == OPT_GLOBAL)
1270
return (unsigned char*) &(global_system_variables.*offset);
1271
return (unsigned char*) &(thd->variables.*offset);
1367
return (uchar*) &(global_system_variables.*offset);
1368
return (uchar*) &(thd->variables.*offset);
1275
bool sys_var::check_enum(THD *thd __attribute__((unused)),
1372
bool sys_var::check_enum(THD *thd __attribute__((__unused__)),
1276
1373
set_var *var, const TYPELIB *enum_names)
1278
1375
char buff[STRING_BUFFER_USUAL_SIZE];
1312
bool sys_var::check_set(THD *thd __attribute__((unused)),
1409
bool sys_var::check_set(THD *thd __attribute__((__unused__)),
1313
1410
set_var *var, TYPELIB *enum_names)
1316
1413
char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
1317
uint32_t error_len= 0;
1318
1415
String str(buff, sizeof(buff), system_charset_info), *res;
1320
1417
if (var->value->result_type() == STRING_RESULT)
1322
1419
if (!(res= var->value->val_str(&str)))
1324
my_stpcpy(buff, "NULL");
1421
strmov(buff, "NULL");
1511
unsigned char *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
1512
LEX_STRING *base __attribute__((unused)))
1608
uchar *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
1609
LEX_STRING *base __attribute__((__unused__)))
1514
1611
ulong tmp= ((type == OPT_GLOBAL) ?
1515
1612
global_system_variables.*offset :
1516
1613
thd->variables.*offset);
1517
return (unsigned char*) enum_names->type_names[tmp];
1614
return (uchar*) enum_names->type_names[tmp];
1520
1617
bool sys_var_thd_bit::check(THD *thd, set_var *var)
1533
unsigned char *sys_var_thd_bit::value_ptr(THD *thd,
1534
enum_var_type type __attribute__((unused)),
1535
LEX_STRING *base __attribute__((unused)))
1630
uchar *sys_var_thd_bit::value_ptr(THD *thd,
1631
enum_var_type type __attribute__((__unused__)),
1632
LEX_STRING *base __attribute__((__unused__)))
1538
1635
If reverse is 0 (default) return 1 if bit is set.
1539
1636
If reverse is 1, return 0 if bit is set
1541
thd->sys_var_tmp.bool_value= ((thd->options & bit_flag) ?
1638
thd->sys_var_tmp.my_bool_value= ((thd->options & bit_flag) ?
1542
1639
!reverse : reverse);
1543
return (unsigned char*) &thd->sys_var_tmp.bool_value;
1640
return (uchar*) &thd->sys_var_tmp.my_bool_value;
1653
1750
const char *new_name;
1656
bool sys_var_collation::check(THD *thd __attribute__((unused)),
1753
static my_old_conv old_conv[]=
1755
{ "cp1251_koi8" , "cp1251" },
1756
{ "cp1250_latin2" , "cp1250" },
1757
{ "kam_latin2" , "keybcs2" },
1758
{ "mac_latin2" , "MacRoman" },
1759
{ "macce_latin2" , "MacCE" },
1760
{ "pc2_latin2" , "pclatin2" },
1761
{ "vga_latin2" , "pclatin1" },
1762
{ "koi8_cp1251" , "koi8r" },
1763
{ "win1251ukr_koi8_ukr" , "win1251ukr" },
1764
{ "koi8_ukr_win1251ukr" , "koi8u" },
1768
CHARSET_INFO *get_old_charset_by_name(const char *name)
1772
for (conv= old_conv; conv->old_name; conv++)
1774
if (!my_strcasecmp(&my_charset_latin1, name, conv->old_name))
1775
return get_charset_by_csname(conv->new_name, MY_CS_PRIMARY, MYF(0));
1781
bool sys_var_collation::check(THD *thd __attribute__((__unused__)),
1659
const CHARSET_INFO *tmp;
1661
1786
if (var->value->result_type() == STRING_RESULT)
1738
unsigned char *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
1739
LEX_STRING *base __attribute__((unused)))
1864
uchar *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
1865
LEX_STRING *base __attribute__((__unused__)))
1741
const CHARSET_INFO * const cs= ci_ptr(thd,type)[0];
1742
return cs ? (unsigned char*) cs->csname : (unsigned char*) NULL;
1867
CHARSET_INFO *cs= ci_ptr(thd,type)[0];
1868
return cs ? (uchar*) cs->csname : (uchar*) NULL;
1827
unsigned char *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
1828
LEX_STRING *base __attribute__((unused)))
1953
uchar *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
1954
LEX_STRING *base __attribute__((__unused__)))
1830
const CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
1956
CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
1831
1957
global_system_variables.*offset : thd->variables.*offset);
1832
return cs ? (unsigned char*) cs->name : (unsigned char*) "NULL";
1958
return cs ? (uchar*) cs->name : (uchar*) "NULL";
1850
unsigned char *sys_var_key_cache_param::value_ptr(THD *thd __attribute__((unused)),
1851
enum_var_type type __attribute__((unused)),
1852
LEX_STRING *base __attribute__((unused)))
1976
uchar *sys_var_key_cache_param::value_ptr(THD *thd __attribute__((__unused__)),
1977
enum_var_type type __attribute__((__unused__)),
1978
LEX_STRING *base __attribute__((__unused__)))
1854
1980
KEY_CACHE *key_cache= get_key_cache(base);
1855
1981
if (!key_cache)
1856
1982
key_cache= &zero_key_cache;
1857
return (unsigned char*) key_cache + offset ;
1983
return (uchar*) key_cache + offset ;
2003
bool sys_var_log_state::update(THD *thd __attribute__((unused)), set_var *var)
2129
bool sys_var_log_state::update(THD *thd, set_var *var)
2006
2132
pthread_mutex_lock(&LOCK_global_system_variables);
2007
2133
if (!var->save_result.ulong_value)
2135
logger.deactivate_log_handler(thd, log_type);
2139
res= logger.activate_log_handler(thd, log_type);
2011
2140
pthread_mutex_unlock(&LOCK_global_system_variables);
2015
void sys_var_log_state::set_default(THD *thd __attribute__((unused)),
2016
enum_var_type type __attribute__((unused)))
2021
bool update_sys_var_str_path(THD *thd __attribute__((unused)),
2144
void sys_var_log_state::set_default(THD *thd,
2145
enum_var_type type __attribute__((__unused__)))
2147
pthread_mutex_lock(&LOCK_global_system_variables);
2148
logger.deactivate_log_handler(thd, log_type);
2149
pthread_mutex_unlock(&LOCK_global_system_variables);
2153
static int sys_check_log_path(THD *thd __attribute__((__unused__)),
2156
char path[FN_REFLEN], buff[FN_REFLEN];
2158
String str(buff, sizeof(buff), system_charset_info), *res;
2159
const char *log_file_str;
2162
if (!(res= var->value->val_str(&str)))
2165
log_file_str= res->c_ptr();
2166
bzero(&f_stat, sizeof(struct stat));
2168
path_length= unpack_filename(path, log_file_str);
2172
/* File name is empty. */
2177
if (!stat(path, &f_stat))
2180
A file system object exists. Check if argument is a file and we have
2184
if (!MY_S_ISREG(f_stat.st_mode) ||
2185
!(f_stat.st_mode & MY_S_IWRITE))
2191
/* Get dirname of the file path. */
2192
(void) dirname_part(path, log_file_str, &path_length);
2194
/* Dirname is empty if file path is relative. */
2199
Check if directory exists and we have permission to create file and
2202
if (my_access(path, (F_OK|W_OK)))
2208
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name,
2209
res ? log_file_str : "NULL");
2214
bool update_sys_var_str_path(THD *thd __attribute__((__unused__)),
2022
2215
sys_var_str *var_str,
2023
2216
set_var *var, const char *log_ext,
2024
bool log_state, uint32_t log_type)
2217
bool log_state, uint log_type)
2219
MYSQL_QUERY_LOG *file_log;
2026
2220
char buff[FN_REFLEN];
2027
2221
char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
2028
2222
bool result= 0;
2029
uint32_t str_length= (var ? var->value->str_value.length() : 0);
2223
uint str_length= (var ? var->value->str_value.length() : 0);
2031
2225
switch (log_type) {
2226
case QUERY_LOG_SLOW:
2227
file_log= logger.get_slow_log_file_handler();
2229
case QUERY_LOG_GENERAL:
2230
file_log= logger.get_log_file_handler();
2033
2233
assert(0); // Impossible
2047
2247
pthread_mutex_lock(&LOCK_global_system_variables);
2048
2248
logger.lock_exclusive();
2250
if (file_log && log_state)
2050
2252
old_value= var_str->value;
2051
2253
var_str->value= res;
2052
2254
var_str->value_length= str_length;
2255
my_free(old_value, MYF(MY_ALLOW_ZERO_PTR));
2256
if (file_log && log_state)
2056
2258
switch (log_type) {
2259
case QUERY_LOG_SLOW:
2260
file_log->open_slow_log(sys_var_slow_log_path.value);
2262
case QUERY_LOG_GENERAL:
2263
file_log->open_query_log(sys_var_general_log_path.value);
2070
bool sys_var_log_output::update(THD *thd __attribute__((unused)),
2278
static bool sys_update_general_log_path(THD *thd, set_var * var)
2280
return update_sys_var_str_path(thd, &sys_var_general_log_path,
2281
var, ".log", opt_log, QUERY_LOG_GENERAL);
2285
static void sys_default_general_log_path(THD *thd,
2286
enum_var_type type __attribute__((__unused__)))
2288
(void) update_sys_var_str_path(thd, &sys_var_general_log_path,
2289
0, ".log", opt_log, QUERY_LOG_GENERAL);
2293
static bool sys_update_slow_log_path(THD *thd, set_var * var)
2295
return update_sys_var_str_path(thd, &sys_var_slow_log_path,
2296
var, "-slow.log", opt_slow_log,
2301
static void sys_default_slow_log_path(THD *thd,
2302
enum_var_type type __attribute__((__unused__)))
2304
(void) update_sys_var_str_path(thd, &sys_var_slow_log_path,
2305
0, "-slow.log", opt_slow_log,
2310
bool sys_var_log_output::update(THD *thd __attribute__((__unused__)),
2073
2313
pthread_mutex_lock(&LOCK_global_system_variables);
2074
2314
logger.lock_exclusive();
2315
logger.init_slow_log(var->save_result.ulong_value);
2316
logger.init_general_log(var->save_result.ulong_value);
2075
2317
*value= var->save_result.ulong_value;
2076
2318
logger.unlock();
2077
2319
pthread_mutex_unlock(&LOCK_global_system_variables);
2082
void sys_var_log_output::set_default(THD *thd __attribute__((unused)),
2083
enum_var_type type __attribute__((unused)))
2324
void sys_var_log_output::set_default(THD *thd __attribute__((__unused__)),
2325
enum_var_type type __attribute__((__unused__)))
2085
2327
pthread_mutex_lock(&LOCK_global_system_variables);
2086
2328
logger.lock_exclusive();
2329
logger.init_slow_log(LOG_FILE);
2330
logger.init_general_log(LOG_FILE);
2087
2331
*value= LOG_FILE;
2088
2332
logger.unlock();
2089
2333
pthread_mutex_unlock(&LOCK_global_system_variables);
2093
unsigned char *sys_var_log_output::value_ptr(THD *thd,
2094
enum_var_type type __attribute__((unused)),
2095
LEX_STRING *base __attribute__((unused)))
2337
uchar *sys_var_log_output::value_ptr(THD *thd,
2338
enum_var_type type __attribute__((__unused__)),
2339
LEX_STRING *base __attribute__((__unused__)))
2097
2341
char buff[256];
2098
String tmp(buff, sizeof(buff), &my_charset_utf8_general_ci);
2342
String tmp(buff, sizeof(buff), &my_charset_latin1);
2100
2344
ulong val= *value;
2103
for (uint32_t i= 0; val; val>>= 1, i++)
2347
for (uint i= 0; val; val>>= 1, i++)
2154
2398
void sys_var_timestamp::set_default(THD *thd,
2155
enum_var_type type __attribute__((unused)))
2399
enum_var_type type __attribute__((__unused__)))
2157
2401
thd->user_time=0;
2161
unsigned char *sys_var_timestamp::value_ptr(THD *thd,
2162
enum_var_type type __attribute__((unused)),
2163
LEX_STRING *base __attribute__((unused)))
2405
uchar *sys_var_timestamp::value_ptr(THD *thd,
2406
enum_var_type type __attribute__((__unused__)),
2407
LEX_STRING *base __attribute__((__unused__)))
2165
2409
thd->sys_var_tmp.long_value= (long) thd->start_time;
2166
return (unsigned char*) &thd->sys_var_tmp.long_value;
2410
return (uchar*) &thd->sys_var_tmp.long_value;
2178
unsigned char *sys_var_last_insert_id::value_ptr(THD *thd,
2179
enum_var_type type __attribute__((unused)),
2180
LEX_STRING *base __attribute__((unused)))
2422
uchar *sys_var_last_insert_id::value_ptr(THD *thd,
2423
enum_var_type type __attribute__((__unused__)),
2424
LEX_STRING *base __attribute__((__unused__)))
2183
2427
this tmp var makes it robust againt change of type of
2199
unsigned char *sys_var_insert_id::value_ptr(THD *thd,
2200
enum_var_type type __attribute__((unused)),
2201
LEX_STRING *base __attribute__((unused)))
2443
uchar *sys_var_insert_id::value_ptr(THD *thd,
2444
enum_var_type type __attribute__((__unused__)),
2445
LEX_STRING *base __attribute__((__unused__)))
2203
2447
thd->sys_var_tmp.uint64_t_value=
2204
2448
thd->auto_inc_intervals_forced.minimum();
2205
return (unsigned char*) &thd->sys_var_tmp.uint64_t_value;
2449
return (uchar*) &thd->sys_var_tmp.uint64_t_value;
2222
2466
bool sys_var_thd_time_zone::check(THD *thd, set_var *var)
2224
2468
char buff[MAX_TIME_ZONE_NAME_LENGTH];
2225
String str(buff, sizeof(buff), &my_charset_utf8_general_ci);
2469
String str(buff, sizeof(buff), &my_charset_latin1);
2226
2470
String *res= var->value->val_str(&str);
2228
2472
if (!(var->save_result.time_zone= my_tz_find(thd, res)))
2252
unsigned char *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
2253
LEX_STRING *base __attribute__((unused)))
2496
uchar *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
2497
LEX_STRING *base __attribute__((__unused__)))
2256
2500
We can use ptr() instead of c_ptr() here because String contaning
2257
2501
time zone name is guaranteed to be zero ended.
2259
2503
if (type == OPT_GLOBAL)
2260
return (unsigned char *)(global_system_variables.time_zone->get_name()->ptr());
2504
return (uchar *)(global_system_variables.time_zone->get_name()->ptr());
2336
unsigned char *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
2337
LEX_STRING *base __attribute__((unused)))
2580
uchar *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
2581
LEX_STRING *base __attribute__((__unused__)))
2339
2583
if (type != OPT_GLOBAL &&
2340
2584
thd->user_connect && thd->user_connect->user_resources.user_conn)
2341
return (unsigned char*) &(thd->user_connect->user_resources.user_conn);
2342
return (unsigned char*) &(max_user_connections);
2585
return (uchar*) &(thd->user_connect->user_resources.user_conn);
2586
return (uchar*) &(max_user_connections);
2346
bool sys_var_thd_lc_time_names::check(THD *thd __attribute__((unused)),
2590
bool sys_var_thd_lc_time_names::check(THD *thd __attribute__((__unused__)),
2349
2593
MY_LOCALE *locale_match;
2394
unsigned char *sys_var_thd_lc_time_names::value_ptr(THD *thd,
2638
uchar *sys_var_thd_lc_time_names::value_ptr(THD *thd,
2395
2639
enum_var_type type,
2396
LEX_STRING *base __attribute__((unused)))
2640
LEX_STRING *base __attribute__((__unused__)))
2398
2642
return type == OPT_GLOBAL ?
2399
(unsigned char *) global_system_variables.lc_time_names->name :
2400
(unsigned char *) thd->variables.lc_time_names->name;
2643
(uchar *) global_system_variables.lc_time_names->name :
2644
(uchar *) thd->variables.lc_time_names->name;
2456
unsigned char *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
2457
LEX_STRING *base __attribute__((unused)))
2700
uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
2701
LEX_STRING *base __attribute__((__unused__)))
2459
2703
thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
2460
2704
global_system_variables.*offset :
2461
2705
thd->variables.*offset) / 1000000.0;
2462
return (unsigned char*) &thd->tmp_double_value;
2706
return (uchar*) &thd->tmp_double_value;
2512
static int check_log_update(THD *thd __attribute__((unused)),
2513
set_var *var __attribute__((unused)))
2519
static int check_pseudo_thread_id(THD *thd __attribute__((unused)),
2756
static int check_log_update(THD *thd __attribute__((__unused__)),
2757
set_var *var __attribute__((__unused__)))
2762
static bool set_log_update(THD *thd __attribute__((__unused__)),
2763
set_var *var __attribute__((__unused__)))
2766
The update log is not supported anymore since 5.0.
2767
See sql/mysqld.cc/, comments in function init_server_components() for an
2768
explaination of the different warnings we send below
2771
if (opt_sql_bin_update)
2773
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
2774
ER_UPDATE_LOG_DEPRECATED_TRANSLATED,
2775
ER(ER_UPDATE_LOG_DEPRECATED_TRANSLATED));
2778
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
2779
ER_UPDATE_LOG_DEPRECATED_IGNORED,
2780
ER(ER_UPDATE_LOG_DEPRECATED_IGNORED));
2781
set_option_bit(thd, var);
2786
static int check_pseudo_thread_id(THD *thd __attribute__((__unused__)),
2522
2789
var->save_result.uint64_t_value= var->value->val_int();
2526
static unsigned char *get_warning_count(THD *thd)
2793
static uchar *get_warning_count(THD *thd)
2528
2795
thd->sys_var_tmp.long_value=
2529
(thd->warn_count[(uint) DRIZZLE_ERROR::WARN_LEVEL_NOTE] +
2530
thd->warn_count[(uint) DRIZZLE_ERROR::WARN_LEVEL_ERROR] +
2531
thd->warn_count[(uint) DRIZZLE_ERROR::WARN_LEVEL_WARN]);
2532
return (unsigned char*) &thd->sys_var_tmp.long_value;
2796
(thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] +
2797
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR] +
2798
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]);
2799
return (uchar*) &thd->sys_var_tmp.long_value;
2535
static unsigned char *get_error_count(THD *thd)
2802
static uchar *get_error_count(THD *thd)
2537
2804
thd->sys_var_tmp.long_value=
2538
thd->warn_count[(uint) DRIZZLE_ERROR::WARN_LEVEL_ERROR];
2539
return (unsigned char*) &thd->sys_var_tmp.long_value;
2805
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR];
2806
return (uchar*) &thd->sys_var_tmp.long_value;
2555
2822
ptr pointer to NUL-terminated string
2557
static unsigned char *get_tmpdir(THD *thd __attribute__((unused)))
2824
static uchar *get_tmpdir(THD *thd __attribute__((__unused__)))
2559
2826
if (opt_mysql_tmpdir)
2560
return (unsigned char *)opt_mysql_tmpdir;
2561
return (unsigned char*)mysql_tmpdir;
2827
return (uchar *)opt_mysql_tmpdir;
2828
return (uchar*)mysql_tmpdir;
2564
2831
/****************************************************************************
2604
2871
Return variable name and length for hashing of variables.
2607
static unsigned char *get_sys_var_length(const sys_var *var, size_t *length,
2608
bool first __attribute__((unused)))
2874
static uchar *get_sys_var_length(const sys_var *var, size_t *length,
2875
my_bool first __attribute__((__unused__)))
2610
2877
*length= var->name_length;
2611
return (unsigned char*) var->name;
2878
return (uchar*) var->name;
3009
3284
!(engine_name.str= (char *)res->ptr()) ||
3010
3285
!(engine_name.length= res->length()) ||
3011
3286
!(var->save_result.plugin= ha_resolve_by_name(thd, &engine_name)) ||
3012
!(hton= plugin_data(var->save_result.plugin, handlerton *)))
3287
!(hton= plugin_data(var->save_result.plugin, handlerton *)) ||
3288
ha_checktype(thd, ha_legacy_type(hton), 1, 0) != hton)
3014
3290
value= res ? res->c_ptr() : "NULL";
3035
3311
plugin= my_plugin_lock(thd, &(global_system_variables.*offset));
3036
3312
hton= plugin_data(plugin, handlerton*);
3037
3313
engine_name= &hton2plugin[hton->slot]->name;
3038
result= (unsigned char *) thd->strmake(engine_name->str, engine_name->length);
3314
result= (uchar *) thd->strmake(engine_name->str, engine_name->length);
3039
3315
if (type == OPT_GLOBAL)
3040
3316
plugin_unlock(thd, plugin);
3081
3357
symbolic_mode_representation(THD *thd, uint64_t val, LEX_STRING *rep)
3083
3359
char buff[STRING_BUFFER_USUAL_SIZE*8];
3084
String tmp(buff, sizeof(buff), &my_charset_utf8_general_ci);
3360
String tmp(buff, sizeof(buff), &my_charset_latin1);
3088
for (uint32_t i= 0; val; val>>= 1, i++)
3364
for (uint i= 0; val; val>>= 1, i++)
3109
unsigned char *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
3110
LEX_STRING *base __attribute__((unused)))
3385
uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
3386
LEX_STRING *base __attribute__((__unused__)))
3112
3388
LEX_STRING opts;
3113
3389
uint64_t val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
3114
3390
thd->variables.*offset);
3115
3391
(void) symbolic_mode_representation(thd, val, &opts);
3116
return (unsigned char *) opts.str;
3392
return (uchar *) opts.str;
3164
3440
/* Key cache functions */
3166
static KEY_CACHE *create_key_cache(const char *name, uint32_t length)
3442
static KEY_CACHE *create_key_cache(const char *name, uint length)
3168
3444
KEY_CACHE *key_cache;
3170
3446
if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE),
3171
3447
MYF(MY_ZEROFILL | MY_WME))))
3173
if (!new NAMED_LIST(&key_caches, name, length, (unsigned char*) key_cache))
3449
if (!new NAMED_LIST(&key_caches, name, length, (uchar*) key_cache))
3175
free((char*) key_cache);
3451
my_free((char*) key_cache, MYF(0));