692
static bool sys_update_init_connect(THD *thd __attribute__((__unused__)), set_var *var)
692
static bool sys_update_init_connect(THD *thd __attribute__((unused)), set_var *var)
694
694
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__)))
698
static void sys_default_init_connect(THD* thd __attribute__((unused)),
699
enum_var_type type __attribute__((unused)))
701
701
update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, 0);
705
static bool sys_update_init_slave(THD *thd __attribute__((__unused__)),
705
static bool sys_update_init_slave(THD *thd __attribute__((unused)),
708
708
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__)))
712
static void sys_default_init_slave(THD* thd __attribute__((unused)),
713
enum_var_type type __attribute__((unused)))
715
715
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__)))
737
fix_myisam_max_sort_file_size(THD *thd __attribute__((unused)),
738
enum_var_type type __attribute__((unused)))
740
740
myisam_max_temp_length=
741
741
(my_off_t) global_system_variables.myisam_max_sort_file_size;
785
785
static void fix_completion_type(THD *thd __attribute__((unused)),
786
786
enum_var_type type __attribute__((unused))) {}
788
static int check_completion_type(THD *thd __attribute__((__unused__)),
788
static int check_completion_type(THD *thd __attribute__((unused)),
791
791
int64_t val= var->value->val_int();
835
835
#endif /* HAVE_REPLICATION */
838
extern void fix_delay_key_write(THD *thd __attribute__((__unused__)),
839
enum_var_type type __attribute__((__unused__)))
838
extern void fix_delay_key_write(THD *thd __attribute__((unused)),
839
enum_var_type type __attribute__((unused)))
841
841
switch ((enum_delay_key_write) delay_key_write_options) {
842
842
case DELAY_KEY_WRITE_NONE:
862
862
uchar *sys_var_set::value_ptr(THD *thd,
863
enum_var_type type __attribute__((__unused__)),
864
LEX_STRING *base __attribute__((__unused__)))
863
enum_var_type type __attribute__((unused)),
864
LEX_STRING *base __attribute__((unused)))
867
867
String tmp(buff, sizeof(buff), &my_charset_latin1);
884
884
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__)))
887
void sys_var_set_slave_mode::set_default(THD *thd __attribute__((unused)),
888
enum_var_type type __attribute__((unused)))
890
890
slave_exec_mode_options= 0;
891
891
bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
916
void fix_slave_exec_mode(enum_var_type type __attribute__((__unused__)))
916
void fix_slave_exec_mode(enum_var_type type __attribute__((unused)))
918
918
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
919
919
bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
964
964
void fix_binlog_format_after_update(THD *thd,
965
enum_var_type type __attribute__((__unused__)))
965
enum_var_type type __attribute__((unused)))
967
967
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__)))
971
static void fix_max_binlog_size(THD *thd __attribute__((unused)),
972
enum_var_type type __attribute__((unused)))
974
974
mysql_bin_log.set_max_size(max_binlog_size);
975
975
#ifdef HAVE_REPLICATION
982
static void fix_max_relay_log_size(THD *thd __attribute__((__unused__)),
983
enum_var_type type __attribute__((__unused__)))
982
static void fix_max_relay_log_size(THD *thd __attribute__((unused)),
983
enum_var_type type __attribute__((unused)))
985
985
#ifdef HAVE_REPLICATION
986
986
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__)))
992
static void fix_max_connections(THD *thd __attribute__((unused)),
993
enum_var_type type __attribute__((unused)))
995
995
resize_thr_alarm(max_connections + 10);
1017
static void fix_server_id(THD *thd __attribute__((__unused__)),
1018
enum_var_type type __attribute__((__unused__)))
1017
static void fix_server_id(THD *thd __attribute__((unused)),
1018
enum_var_type type __attribute__((unused)))
1020
1020
server_id_supplied = 1;
1021
1021
thd->server_id= server_id;
1054
static bool get_unsigned(THD *thd __attribute__((__unused__)), set_var *var)
1054
static bool get_unsigned(THD *thd __attribute__((unused)), set_var *var)
1056
1056
if (var->value->unsigned_flag)
1057
1057
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__)))
1105
void sys_var_long_ptr_global::set_default(THD *thd __attribute__((unused)), enum_var_type type __attribute__((unused)))
1108
1108
pthread_mutex_lock(guard);
1128
void sys_var_uint64_t_ptr::set_default(THD *thd __attribute__((__unused__)),
1129
enum_var_type type __attribute__((__unused__)))
1128
void sys_var_uint64_t_ptr::set_default(THD *thd __attribute__((unused)),
1129
enum_var_type type __attribute__((unused)))
1132
1132
pthread_mutex_lock(&LOCK_global_system_variables);
1139
bool sys_var_bool_ptr::update(THD *thd __attribute__((__unused__)), set_var *var)
1139
bool sys_var_bool_ptr::update(THD *thd __attribute__((unused)), set_var *var)
1141
1141
*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__)))
1146
void sys_var_bool_ptr::set_default(THD *thd __attribute__((unused)), enum_var_type type __attribute__((unused)))
1148
1148
*value= (bool) option_limits->def_value;
1152
bool sys_var_enum::update(THD *thd __attribute__((__unused__)), set_var *var)
1152
bool sys_var_enum::update(THD *thd __attribute__((unused)), set_var *var)
1154
1154
*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__)))
1159
uchar *sys_var_enum::value_ptr(THD *thd __attribute__((unused)),
1160
enum_var_type type __attribute__((unused)),
1161
LEX_STRING *base __attribute__((unused)))
1163
1163
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__)))
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)))
1171
1171
return (uchar*) enum_names->type_names[global_system_variables.*offset];
1225
1225
uchar *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
1226
LEX_STRING *base __attribute__((__unused__)))
1226
LEX_STRING *base __attribute__((unused)))
1228
1228
if (type == OPT_GLOBAL)
1229
1229
return (uchar*) &(global_system_variables.*offset);
1274
1274
uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
1275
LEX_STRING *base __attribute__((__unused__)))
1275
LEX_STRING *base __attribute__((unused)))
1277
1277
if (type == OPT_GLOBAL)
1278
1278
return (uchar*) &(global_system_variables.*offset);
1325
1325
uchar *sys_var_thd_uint64_t::value_ptr(THD *thd, enum_var_type type,
1326
LEX_STRING *base __attribute__((__unused__)))
1326
LEX_STRING *base __attribute__((unused)))
1328
1328
if (type == OPT_GLOBAL)
1329
1329
return (uchar*) &(global_system_variables.*offset);
1353
1353
uchar *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
1354
LEX_STRING *base __attribute__((__unused__)))
1354
LEX_STRING *base __attribute__((unused)))
1356
1356
if (type == OPT_GLOBAL)
1357
1357
return (uchar*) &(global_system_variables.*offset);
1362
bool sys_var::check_enum(THD *thd __attribute__((__unused__)),
1362
bool sys_var::check_enum(THD *thd __attribute__((unused)),
1363
1363
set_var *var, const TYPELIB *enum_names)
1365
1365
char buff[STRING_BUFFER_USUAL_SIZE];
1399
bool sys_var::check_set(THD *thd __attribute__((__unused__)),
1399
bool sys_var::check_set(THD *thd __attribute__((unused)),
1400
1400
set_var *var, TYPELIB *enum_names)
1598
1598
uchar *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
1599
LEX_STRING *base __attribute__((__unused__)))
1599
LEX_STRING *base __attribute__((unused)))
1601
1601
ulong tmp= ((type == OPT_GLOBAL) ?
1602
1602
global_system_variables.*offset :
1620
1620
uchar *sys_var_thd_bit::value_ptr(THD *thd,
1621
enum_var_type type __attribute__((__unused__)),
1622
LEX_STRING *base __attribute__((__unused__)))
1621
enum_var_type type __attribute__((unused)),
1622
LEX_STRING *base __attribute__((unused)))
1625
1625
If reverse is 0 (default) return 1 if bit is set.
1854
1854
uchar *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
1855
LEX_STRING *base __attribute__((__unused__)))
1855
LEX_STRING *base __attribute__((unused)))
1857
1857
CHARSET_INFO *cs= ci_ptr(thd,type)[0];
1858
1858
return cs ? (uchar*) cs->csname : (uchar*) NULL;
1943
1943
uchar *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
1944
LEX_STRING *base __attribute__((__unused__)))
1944
LEX_STRING *base __attribute__((unused)))
1946
1946
CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
1947
1947
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__)))
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)))
1970
1970
KEY_CACHE *key_cache= get_key_cache(base);
1971
1971
if (!key_cache)
2134
2134
void sys_var_log_state::set_default(THD *thd,
2135
enum_var_type type __attribute__((__unused__)))
2135
enum_var_type type __attribute__((unused)))
2137
2137
pthread_mutex_lock(&LOCK_global_system_variables);
2138
2138
logger.deactivate_log_handler(thd, log_type);
2143
static int sys_check_log_path(THD *thd __attribute__((__unused__)),
2143
static int sys_check_log_path(THD *thd __attribute__((unused)),
2146
2146
char path[FN_REFLEN], buff[FN_REFLEN];
2204
bool update_sys_var_str_path(THD *thd __attribute__((__unused__)),
2204
bool update_sys_var_str_path(THD *thd __attribute__((unused)),
2205
2205
sys_var_str *var_str,
2206
2206
set_var *var, const char *log_ext,
2207
2207
bool log_state, uint log_type)
2275
2275
static void sys_default_general_log_path(THD *thd,
2276
enum_var_type type __attribute__((__unused__)))
2276
enum_var_type type __attribute__((unused)))
2278
2278
(void) update_sys_var_str_path(thd, &sys_var_general_log_path,
2279
2279
0, ".log", opt_log, QUERY_LOG_GENERAL);
2291
2291
static void sys_default_slow_log_path(THD *thd,
2292
enum_var_type type __attribute__((__unused__)))
2292
enum_var_type type __attribute__((unused)))
2294
2294
(void) update_sys_var_str_path(thd, &sys_var_slow_log_path,
2295
2295
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__)))
2314
void sys_var_log_output::set_default(THD *thd __attribute__((unused)),
2315
enum_var_type type __attribute__((unused)))
2317
2317
pthread_mutex_lock(&LOCK_global_system_variables);
2318
2318
logger.lock_exclusive();
2327
2327
uchar *sys_var_log_output::value_ptr(THD *thd,
2328
enum_var_type type __attribute__((__unused__)),
2329
LEX_STRING *base __attribute__((__unused__)))
2328
enum_var_type type __attribute__((unused)),
2329
LEX_STRING *base __attribute__((unused)))
2331
2331
char buff[256];
2332
2332
String tmp(buff, sizeof(buff), &my_charset_latin1);
2354
2354
Functions to handle SET NAMES and SET CHARACTER SET
2355
2355
*****************************************************************************/
2357
int set_var_collation_client::check(THD *thd __attribute__((__unused__)))
2357
int set_var_collation_client::check(THD *thd __attribute__((unused)))
2359
2359
/* Currently, UCS-2 cannot be used as a client character set */
2360
2360
if (character_set_client->mbminlen > 1)
2388
2388
void sys_var_timestamp::set_default(THD *thd,
2389
enum_var_type type __attribute__((__unused__)))
2389
enum_var_type type __attribute__((unused)))
2391
2391
thd->user_time=0;
2395
2395
uchar *sys_var_timestamp::value_ptr(THD *thd,
2396
enum_var_type type __attribute__((__unused__)),
2397
LEX_STRING *base __attribute__((__unused__)))
2396
enum_var_type type __attribute__((unused)),
2397
LEX_STRING *base __attribute__((unused)))
2399
2399
thd->sys_var_tmp.long_value= (long) thd->start_time;
2400
2400
return (uchar*) &thd->sys_var_tmp.long_value;
2412
2412
uchar *sys_var_last_insert_id::value_ptr(THD *thd,
2413
enum_var_type type __attribute__((__unused__)),
2414
LEX_STRING *base __attribute__((__unused__)))
2413
enum_var_type type __attribute__((unused)),
2414
LEX_STRING *base __attribute__((unused)))
2417
2417
this tmp var makes it robust againt change of type of
2433
2433
uchar *sys_var_insert_id::value_ptr(THD *thd,
2434
enum_var_type type __attribute__((__unused__)),
2435
LEX_STRING *base __attribute__((__unused__)))
2434
enum_var_type type __attribute__((unused)),
2435
LEX_STRING *base __attribute__((unused)))
2437
2437
thd->sys_var_tmp.uint64_t_value=
2438
2438
thd->auto_inc_intervals_forced.minimum();
2486
2486
uchar *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
2487
LEX_STRING *base __attribute__((__unused__)))
2487
LEX_STRING *base __attribute__((unused)))
2490
2490
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__)))
2560
void sys_var_max_user_conn::set_default(THD *thd __attribute__((unused)),
2561
enum_var_type type __attribute__((unused)))
2563
2563
assert(type == OPT_GLOBAL);
2564
2564
pthread_mutex_lock(&LOCK_global_system_variables);
2570
2570
uchar *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
2571
LEX_STRING *base __attribute__((__unused__)))
2571
LEX_STRING *base __attribute__((unused)))
2573
2573
if (type != OPT_GLOBAL &&
2574
2574
thd->user_connect && thd->user_connect->user_resources.user_conn)
2628
2628
uchar *sys_var_thd_lc_time_names::value_ptr(THD *thd,
2629
2629
enum_var_type type,
2630
LEX_STRING *base __attribute__((__unused__)))
2630
LEX_STRING *base __attribute__((unused)))
2632
2632
return type == OPT_GLOBAL ?
2633
2633
(uchar *) global_system_variables.lc_time_names->name :
2690
2690
uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
2691
LEX_STRING *base __attribute__((__unused__)))
2691
LEX_STRING *base __attribute__((unused)))
2693
2693
thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
2694
2694
global_system_variables.*offset :
2746
static int check_log_update(THD *thd __attribute__((__unused__)),
2747
set_var *var __attribute__((__unused__)))
2746
static int check_log_update(THD *thd __attribute__((unused)),
2747
set_var *var __attribute__((unused)))
2752
static bool set_log_update(THD *thd __attribute__((__unused__)),
2753
set_var *var __attribute__((__unused__)))
2752
static bool set_log_update(THD *thd __attribute__((unused)),
2753
set_var *var __attribute__((unused)))
2756
2756
The update log is not supported anymore since 5.0.
2864
2864
static uchar *get_sys_var_length(const sys_var *var, size_t *length,
2865
bool first __attribute__((__unused__)))
2865
bool first __attribute__((unused)))
2867
2867
*length= var->name_length;
2868
2868
return (uchar*) var->name;
3367
3367
uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
3368
LEX_STRING *base __attribute__((__unused__)))
3368
LEX_STRING *base __attribute__((unused)))
3370
3370
LEX_STRING opts;
3371
3371
uint64_t val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :