622
621
{"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
623
622
{"log_error", (char*) log_error_file, SHOW_CHAR},
624
{"lower_case_file_system", (char*) &lower_case_file_system, SHOW_MY_BOOL},
625
{"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT},
626
623
{"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR},
627
624
{"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
628
625
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
629
626
{"plugin_dir", (char*) opt_plugin_dir, SHOW_CHAR},
630
627
{"port", (char*) &mysqld_port, SHOW_INT},
631
628
{"protocol_version", (char*) &protocol_version, SHOW_INT},
632
{"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL},
633
{"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
634
629
{"thread_stack", (char*) &my_thread_stack_size, SHOW_LONG},
638
bool sys_var::check(THD *thd __attribute__((__unused__)), set_var *var)
633
bool sys_var::check(THD *thd __attribute__((unused)), set_var *var)
640
635
var->save_result.uint64_t_value= var->value->val_int();
692
static bool sys_update_init_connect(THD *thd __attribute__((__unused__)), set_var *var)
687
static bool sys_update_init_connect(THD *thd __attribute__((unused)), set_var *var)
694
689
return update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, var);
698
static void sys_default_init_connect(THD* thd __attribute__((__unused__)),
699
enum_var_type type __attribute__((__unused__)))
693
static void sys_default_init_connect(THD* thd __attribute__((unused)),
694
enum_var_type type __attribute__((unused)))
701
696
update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, 0);
705
static bool sys_update_init_slave(THD *thd __attribute__((__unused__)),
700
static bool sys_update_init_slave(THD *thd __attribute__((unused)),
708
703
return update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, var);
712
static void sys_default_init_slave(THD* thd __attribute__((__unused__)),
713
enum_var_type type __attribute__((__unused__)))
707
static void sys_default_init_slave(THD* thd __attribute__((unused)),
708
enum_var_type type __attribute__((unused)))
715
710
update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0);
737
fix_myisam_max_sort_file_size(THD *thd __attribute__((__unused__)),
738
enum_var_type type __attribute__((__unused__)))
732
fix_myisam_max_sort_file_size(THD *thd __attribute__((unused)),
733
enum_var_type type __attribute__((unused)))
740
735
myisam_max_temp_length=
741
736
(my_off_t) global_system_variables.myisam_max_sort_file_size;
785
780
static void fix_completion_type(THD *thd __attribute__((unused)),
786
781
enum_var_type type __attribute__((unused))) {}
788
static int check_completion_type(THD *thd __attribute__((__unused__)),
783
static int check_completion_type(THD *thd __attribute__((unused)),
791
786
int64_t val= var->value->val_int();
835
830
#endif /* HAVE_REPLICATION */
838
extern void fix_delay_key_write(THD *thd __attribute__((__unused__)),
839
enum_var_type type __attribute__((__unused__)))
833
extern void fix_delay_key_write(THD *thd __attribute__((unused)),
834
enum_var_type type __attribute__((unused)))
841
836
switch ((enum_delay_key_write) delay_key_write_options) {
842
837
case DELAY_KEY_WRITE_NONE:
862
857
uchar *sys_var_set::value_ptr(THD *thd,
863
enum_var_type type __attribute__((__unused__)),
864
LEX_STRING *base __attribute__((__unused__)))
858
enum_var_type type __attribute__((unused)),
859
LEX_STRING *base __attribute__((unused)))
867
862
String tmp(buff, sizeof(buff), &my_charset_latin1);
884
879
return (uchar*) thd->strmake(tmp.ptr(), length);
887
void sys_var_set_slave_mode::set_default(THD *thd __attribute__((__unused__)),
888
enum_var_type type __attribute__((__unused__)))
882
void sys_var_set_slave_mode::set_default(THD *thd __attribute__((unused)),
883
enum_var_type type __attribute__((unused)))
890
885
slave_exec_mode_options= 0;
891
886
bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
916
void fix_slave_exec_mode(enum_var_type type __attribute__((__unused__)))
911
void fix_slave_exec_mode(enum_var_type type __attribute__((unused)))
918
913
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
919
914
bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
964
959
void fix_binlog_format_after_update(THD *thd,
965
enum_var_type type __attribute__((__unused__)))
960
enum_var_type type __attribute__((unused)))
967
962
thd->reset_current_stmt_binlog_row_based();
971
static void fix_max_binlog_size(THD *thd __attribute__((__unused__)),
972
enum_var_type type __attribute__((__unused__)))
966
static void fix_max_binlog_size(THD *thd __attribute__((unused)),
967
enum_var_type type __attribute__((unused)))
974
969
mysql_bin_log.set_max_size(max_binlog_size);
975
970
#ifdef HAVE_REPLICATION
982
static void fix_max_relay_log_size(THD *thd __attribute__((__unused__)),
983
enum_var_type type __attribute__((__unused__)))
977
static void fix_max_relay_log_size(THD *thd __attribute__((unused)),
978
enum_var_type type __attribute__((unused)))
985
980
#ifdef HAVE_REPLICATION
986
981
active_mi->rli.relay_log.set_max_size(max_relay_log_size ?
992
static void fix_max_connections(THD *thd __attribute__((__unused__)),
993
enum_var_type type __attribute__((__unused__)))
987
static void fix_max_connections(THD *thd __attribute__((unused)),
988
enum_var_type type __attribute__((unused)))
995
990
resize_thr_alarm(max_connections + 10);
1017
static void fix_server_id(THD *thd __attribute__((__unused__)),
1018
enum_var_type type __attribute__((__unused__)))
1012
static void fix_server_id(THD *thd __attribute__((unused)),
1013
enum_var_type type __attribute__((unused)))
1020
1015
server_id_supplied = 1;
1021
1016
thd->server_id= server_id;
1054
static bool get_unsigned(THD *thd __attribute__((__unused__)), set_var *var)
1049
static bool get_unsigned(THD *thd __attribute__((unused)), set_var *var)
1056
1051
if (var->value->unsigned_flag)
1057
1052
var->save_result.uint64_t_value= (uint64_t) var->value->val_int();
1105
void sys_var_long_ptr_global::set_default(THD *thd __attribute__((__unused__)), enum_var_type type __attribute__((__unused__)))
1100
void sys_var_long_ptr_global::set_default(THD *thd __attribute__((unused)), enum_var_type type __attribute__((unused)))
1108
1103
pthread_mutex_lock(guard);
1128
void sys_var_uint64_t_ptr::set_default(THD *thd __attribute__((__unused__)),
1129
enum_var_type type __attribute__((__unused__)))
1123
void sys_var_uint64_t_ptr::set_default(THD *thd __attribute__((unused)),
1124
enum_var_type type __attribute__((unused)))
1132
1127
pthread_mutex_lock(&LOCK_global_system_variables);
1139
bool sys_var_bool_ptr::update(THD *thd __attribute__((__unused__)), set_var *var)
1134
bool sys_var_bool_ptr::update(THD *thd __attribute__((unused)), set_var *var)
1141
1136
*value= (bool) var->save_result.ulong_value;
1146
void sys_var_bool_ptr::set_default(THD *thd __attribute__((__unused__)), enum_var_type type __attribute__((__unused__)))
1141
void sys_var_bool_ptr::set_default(THD *thd __attribute__((unused)), enum_var_type type __attribute__((unused)))
1148
1143
*value= (bool) option_limits->def_value;
1152
bool sys_var_enum::update(THD *thd __attribute__((__unused__)), set_var *var)
1147
bool sys_var_enum::update(THD *thd __attribute__((unused)), set_var *var)
1154
1149
*value= (uint) var->save_result.ulong_value;
1159
uchar *sys_var_enum::value_ptr(THD *thd __attribute__((__unused__)),
1160
enum_var_type type __attribute__((__unused__)),
1161
LEX_STRING *base __attribute__((__unused__)))
1154
uchar *sys_var_enum::value_ptr(THD *thd __attribute__((unused)),
1155
enum_var_type type __attribute__((unused)),
1156
LEX_STRING *base __attribute__((unused)))
1163
1158
return (uchar*) enum_names->type_names[*value];
1167
uchar *sys_var_enum_const::value_ptr(THD *thd __attribute__((__unused__)),
1168
enum_var_type type __attribute__((__unused__)),
1169
LEX_STRING *base __attribute__((__unused__)))
1162
uchar *sys_var_enum_const::value_ptr(THD *thd __attribute__((unused)),
1163
enum_var_type type __attribute__((unused)),
1164
LEX_STRING *base __attribute__((unused)))
1171
1166
return (uchar*) enum_names->type_names[global_system_variables.*offset];
1225
1220
uchar *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
1226
LEX_STRING *base __attribute__((__unused__)))
1221
LEX_STRING *base __attribute__((unused)))
1228
1223
if (type == OPT_GLOBAL)
1229
1224
return (uchar*) &(global_system_variables.*offset);
1274
1269
uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
1275
LEX_STRING *base __attribute__((__unused__)))
1270
LEX_STRING *base __attribute__((unused)))
1277
1272
if (type == OPT_GLOBAL)
1278
1273
return (uchar*) &(global_system_variables.*offset);
1325
1320
uchar *sys_var_thd_uint64_t::value_ptr(THD *thd, enum_var_type type,
1326
LEX_STRING *base __attribute__((__unused__)))
1321
LEX_STRING *base __attribute__((unused)))
1328
1323
if (type == OPT_GLOBAL)
1329
1324
return (uchar*) &(global_system_variables.*offset);
1353
1348
uchar *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
1354
LEX_STRING *base __attribute__((__unused__)))
1349
LEX_STRING *base __attribute__((unused)))
1356
1351
if (type == OPT_GLOBAL)
1357
1352
return (uchar*) &(global_system_variables.*offset);
1362
bool sys_var::check_enum(THD *thd __attribute__((__unused__)),
1357
bool sys_var::check_enum(THD *thd __attribute__((unused)),
1363
1358
set_var *var, const TYPELIB *enum_names)
1365
1360
char buff[STRING_BUFFER_USUAL_SIZE];
1399
bool sys_var::check_set(THD *thd __attribute__((__unused__)),
1394
bool sys_var::check_set(THD *thd __attribute__((unused)),
1400
1395
set_var *var, TYPELIB *enum_names)
1598
1593
uchar *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
1599
LEX_STRING *base __attribute__((__unused__)))
1594
LEX_STRING *base __attribute__((unused)))
1601
1596
ulong tmp= ((type == OPT_GLOBAL) ?
1602
1597
global_system_variables.*offset :
1620
1615
uchar *sys_var_thd_bit::value_ptr(THD *thd,
1621
enum_var_type type __attribute__((__unused__)),
1622
LEX_STRING *base __attribute__((__unused__)))
1616
enum_var_type type __attribute__((unused)),
1617
LEX_STRING *base __attribute__((unused)))
1625
1620
If reverse is 0 (default) return 1 if bit is set.
1854
1849
uchar *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
1855
LEX_STRING *base __attribute__((__unused__)))
1850
LEX_STRING *base __attribute__((unused)))
1857
1852
CHARSET_INFO *cs= ci_ptr(thd,type)[0];
1858
1853
return cs ? (uchar*) cs->csname : (uchar*) NULL;
1943
1938
uchar *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
1944
LEX_STRING *base __attribute__((__unused__)))
1939
LEX_STRING *base __attribute__((unused)))
1946
1941
CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
1947
1942
global_system_variables.*offset : thd->variables.*offset);
1966
uchar *sys_var_key_cache_param::value_ptr(THD *thd __attribute__((__unused__)),
1967
enum_var_type type __attribute__((__unused__)),
1968
LEX_STRING *base __attribute__((__unused__)))
1961
uchar *sys_var_key_cache_param::value_ptr(THD *thd __attribute__((unused)),
1962
enum_var_type type __attribute__((unused)),
1963
LEX_STRING *base __attribute__((unused)))
1970
1965
KEY_CACHE *key_cache= get_key_cache(base);
1971
1966
if (!key_cache)
2134
2129
void sys_var_log_state::set_default(THD *thd,
2135
enum_var_type type __attribute__((__unused__)))
2130
enum_var_type type __attribute__((unused)))
2137
2132
pthread_mutex_lock(&LOCK_global_system_variables);
2138
2133
logger.deactivate_log_handler(thd, log_type);
2143
static int sys_check_log_path(THD *thd __attribute__((__unused__)),
2138
static int sys_check_log_path(THD *thd __attribute__((unused)),
2146
2141
char path[FN_REFLEN], buff[FN_REFLEN];
2155
2150
log_file_str= res->c_ptr();
2156
bzero(&f_stat, sizeof(struct stat));
2151
memset(&f_stat, 0, sizeof(struct stat));
2158
2153
path_length= unpack_filename(path, log_file_str);
2204
bool update_sys_var_str_path(THD *thd __attribute__((__unused__)),
2199
bool update_sys_var_str_path(THD *thd __attribute__((unused)),
2205
2200
sys_var_str *var_str,
2206
2201
set_var *var, const char *log_ext,
2207
2202
bool log_state, uint log_type)
2275
2270
static void sys_default_general_log_path(THD *thd,
2276
enum_var_type type __attribute__((__unused__)))
2271
enum_var_type type __attribute__((unused)))
2278
2273
(void) update_sys_var_str_path(thd, &sys_var_general_log_path,
2279
2274
0, ".log", opt_log, QUERY_LOG_GENERAL);
2291
2286
static void sys_default_slow_log_path(THD *thd,
2292
enum_var_type type __attribute__((__unused__)))
2287
enum_var_type type __attribute__((unused)))
2294
2289
(void) update_sys_var_str_path(thd, &sys_var_slow_log_path,
2295
2290
0, "-slow.log", opt_slow_log,
2314
void sys_var_log_output::set_default(THD *thd __attribute__((__unused__)),
2315
enum_var_type type __attribute__((__unused__)))
2309
void sys_var_log_output::set_default(THD *thd __attribute__((unused)),
2310
enum_var_type type __attribute__((unused)))
2317
2312
pthread_mutex_lock(&LOCK_global_system_variables);
2318
2313
logger.lock_exclusive();
2327
2322
uchar *sys_var_log_output::value_ptr(THD *thd,
2328
enum_var_type type __attribute__((__unused__)),
2329
LEX_STRING *base __attribute__((__unused__)))
2323
enum_var_type type __attribute__((unused)),
2324
LEX_STRING *base __attribute__((unused)))
2331
2326
char buff[256];
2332
2327
String tmp(buff, sizeof(buff), &my_charset_latin1);
2354
2349
Functions to handle SET NAMES and SET CHARACTER SET
2355
2350
*****************************************************************************/
2357
int set_var_collation_client::check(THD *thd __attribute__((__unused__)))
2352
int set_var_collation_client::check(THD *thd __attribute__((unused)))
2359
2354
/* Currently, UCS-2 cannot be used as a client character set */
2360
2355
if (character_set_client->mbminlen > 1)
2388
2383
void sys_var_timestamp::set_default(THD *thd,
2389
enum_var_type type __attribute__((__unused__)))
2384
enum_var_type type __attribute__((unused)))
2391
2386
thd->user_time=0;
2395
2390
uchar *sys_var_timestamp::value_ptr(THD *thd,
2396
enum_var_type type __attribute__((__unused__)),
2397
LEX_STRING *base __attribute__((__unused__)))
2391
enum_var_type type __attribute__((unused)),
2392
LEX_STRING *base __attribute__((unused)))
2399
2394
thd->sys_var_tmp.long_value= (long) thd->start_time;
2400
2395
return (uchar*) &thd->sys_var_tmp.long_value;
2412
2407
uchar *sys_var_last_insert_id::value_ptr(THD *thd,
2413
enum_var_type type __attribute__((__unused__)),
2414
LEX_STRING *base __attribute__((__unused__)))
2408
enum_var_type type __attribute__((unused)),
2409
LEX_STRING *base __attribute__((unused)))
2417
2412
this tmp var makes it robust againt change of type of
2433
2428
uchar *sys_var_insert_id::value_ptr(THD *thd,
2434
enum_var_type type __attribute__((__unused__)),
2435
LEX_STRING *base __attribute__((__unused__)))
2429
enum_var_type type __attribute__((unused)),
2430
LEX_STRING *base __attribute__((unused)))
2437
2432
thd->sys_var_tmp.uint64_t_value=
2438
2433
thd->auto_inc_intervals_forced.minimum();
2486
2481
uchar *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
2487
LEX_STRING *base __attribute__((__unused__)))
2482
LEX_STRING *base __attribute__((unused)))
2490
2485
We can use ptr() instead of c_ptr() here because String contaning
2560
void sys_var_max_user_conn::set_default(THD *thd __attribute__((__unused__)),
2561
enum_var_type type __attribute__((__unused__)))
2555
void sys_var_max_user_conn::set_default(THD *thd __attribute__((unused)),
2556
enum_var_type type __attribute__((unused)))
2563
2558
assert(type == OPT_GLOBAL);
2564
2559
pthread_mutex_lock(&LOCK_global_system_variables);
2570
2565
uchar *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
2571
LEX_STRING *base __attribute__((__unused__)))
2566
LEX_STRING *base __attribute__((unused)))
2573
2568
if (type != OPT_GLOBAL &&
2574
2569
thd->user_connect && thd->user_connect->user_resources.user_conn)
2628
2623
uchar *sys_var_thd_lc_time_names::value_ptr(THD *thd,
2629
2624
enum_var_type type,
2630
LEX_STRING *base __attribute__((__unused__)))
2625
LEX_STRING *base __attribute__((unused)))
2632
2627
return type == OPT_GLOBAL ?
2633
2628
(uchar *) global_system_variables.lc_time_names->name :
2690
2685
uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
2691
LEX_STRING *base __attribute__((__unused__)))
2686
LEX_STRING *base __attribute__((unused)))
2693
2688
thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
2694
2689
global_system_variables.*offset :
2746
static int check_log_update(THD *thd __attribute__((__unused__)),
2747
set_var *var __attribute__((__unused__)))
2741
static int check_log_update(THD *thd __attribute__((unused)),
2742
set_var *var __attribute__((unused)))
2752
static bool set_log_update(THD *thd __attribute__((__unused__)),
2753
set_var *var __attribute__((__unused__)))
2747
static bool set_log_update(THD *thd __attribute__((unused)),
2748
set_var *var __attribute__((unused)))
2756
2751
The update log is not supported anymore since 5.0.
2864
2859
static uchar *get_sys_var_length(const sys_var *var, size_t *length,
2865
bool first __attribute__((__unused__)))
2860
bool first __attribute__((unused)))
2867
2862
*length= var->name_length;
2868
2863
return (uchar*) var->name;
3367
3362
uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
3368
LEX_STRING *base __attribute__((__unused__)))
3363
LEX_STRING *base __attribute__((unused)))
3370
3365
LEX_STRING opts;
3371
3366
uint64_t val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :