585
static bool sys_update_init_connect(Session *session __attribute__((unused)), set_var *var)
585
static bool sys_update_init_connect(Session *, set_var *var)
587
587
return update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, var);
591
static void sys_default_init_connect(Session* session __attribute__((unused)),
592
enum_var_type type __attribute__((unused)))
591
static void sys_default_init_connect(Session *, enum_var_type)
594
593
update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, 0);
598
static bool sys_update_init_slave(Session *session __attribute__((unused)),
597
static bool sys_update_init_slave(Session *, set_var *var)
601
599
return update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, var);
605
static void sys_default_init_slave(Session* session __attribute__((unused)),
606
enum_var_type type __attribute__((unused)))
603
static void sys_default_init_slave(Session *, enum_var_type)
608
605
update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0);
630
fix_myisam_max_sort_file_size(Session *session __attribute__((unused)),
631
enum_var_type type __attribute__((unused)))
627
fix_myisam_max_sort_file_size(Session *, enum_var_type)
633
629
myisam_max_temp_length=
634
630
(my_off_t) global_system_variables.myisam_max_sort_file_size;
673
669
if (type == OPT_SESSION)
674
670
session->session_tx_isolation= ((enum_tx_isolation)
675
session->variables.tx_isolation);
671
session->variables.tx_isolation);
678
static void fix_completion_type(Session *session __attribute__((unused)),
679
enum_var_type type __attribute__((unused))) {}
674
static void fix_completion_type(Session *, enum_var_type) {}
681
static int check_completion_type(Session *session __attribute__((unused)),
676
static int check_completion_type(Session *, set_var *var)
684
678
int64_t val= var->value->val_int();
685
679
if (val < 0 || val > 2)
719
extern void fix_delay_key_write(Session *session __attribute__((unused)),
720
enum_var_type type __attribute__((unused)))
713
extern void fix_delay_key_write(Session *, enum_var_type)
722
715
switch ((enum_delay_key_write) delay_key_write_options) {
723
716
case DELAY_KEY_WRITE_NONE:
736
bool sys_var_set::update(Session *session __attribute__((unused)),
729
bool sys_var_set::update(Session *, set_var *var)
739
731
*value= var->save_result.uint32_t_value;
743
735
unsigned char *sys_var_set::value_ptr(Session *session,
744
enum_var_type type __attribute__((unused)),
745
LEX_STRING *base __attribute__((unused)))
748
740
String tmp(buff, sizeof(buff), &my_charset_utf8_general_ci);
765
757
return (unsigned char*) session->strmake(tmp.ptr(), length);
768
void sys_var_set_slave_mode::set_default(Session *session __attribute__((unused)),
769
enum_var_type type __attribute__((unused)))
760
void sys_var_set_slave_mode::set_default(Session *, enum_var_type)
771
762
slave_exec_mode_options= 0;
772
763
bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
797
void fix_slave_exec_mode(enum_var_type type __attribute__((unused)))
788
void fix_slave_exec_mode(enum_var_type)
799
790
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
800
791
bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
838
void fix_binlog_format_after_update(Session *session,
839
enum_var_type type __attribute__((unused)))
829
void fix_binlog_format_after_update(Session *session, enum_var_type)
841
831
session->reset_current_stmt_binlog_row_based();
845
static void fix_max_binlog_size(Session *session __attribute__((unused)),
846
enum_var_type type __attribute__((unused)))
835
static void fix_max_binlog_size(Session *, enum_var_type)
848
837
mysql_bin_log.set_max_size(max_binlog_size);
849
838
if (!max_relay_log_size)
854
static void fix_max_relay_log_size(Session *session __attribute__((unused)),
855
enum_var_type type __attribute__((unused)))
843
static void fix_max_relay_log_size(Session *, enum_var_type)
857
845
active_mi->rli.relay_log.set_max_size(max_relay_log_size ?
858
846
max_relay_log_size: max_binlog_size);
862
static void fix_max_connections(Session *session __attribute__((unused)),
863
enum_var_type type __attribute__((unused)))
850
static void fix_max_connections(Session *, enum_var_type)
865
852
resize_thr_alarm(max_connections + 10);
887
static void fix_server_id(Session *session __attribute__((unused)),
888
enum_var_type type __attribute__((unused)))
874
static void fix_server_id(Session *session, enum_var_type)
890
876
server_id_supplied = 1;
891
877
session->server_id= server_id;
924
static bool get_unsigned(Session *session __attribute__((unused)), set_var *var)
910
static bool get_unsigned(Session *, set_var *var)
926
912
if (var->value->unsigned_flag)
927
913
var->save_result.uint64_t_value= (uint64_t) var->value->val_int();
972
void sys_var_long_ptr_global::set_default(Session *session __attribute__((unused)), enum_var_type type __attribute__((unused)))
958
void sys_var_long_ptr_global::set_default(Session *, enum_var_type)
975
961
pthread_mutex_lock(guard);
994
void sys_var_uint32_t_ptr::set_default(Session *session __attribute__((unused)),
995
enum_var_type type __attribute__((unused)))
980
void sys_var_uint32_t_ptr::set_default(Session *, enum_var_type)
998
983
pthread_mutex_lock(&LOCK_global_system_variables);
1018
void sys_var_uint64_t_ptr::set_default(Session *session __attribute__((unused)),
1019
enum_var_type type __attribute__((unused)))
1003
void sys_var_uint64_t_ptr::set_default(Session *, enum_var_type)
1022
1006
pthread_mutex_lock(&LOCK_global_system_variables);
1029
bool sys_var_bool_ptr::update(Session *session __attribute__((unused)), set_var *var)
1013
bool sys_var_bool_ptr::update(Session *, set_var *var)
1031
1015
*value= (bool) var->save_result.uint32_t_value;
1036
void sys_var_bool_ptr::set_default(Session *session __attribute__((unused)), enum_var_type type __attribute__((unused)))
1020
void sys_var_bool_ptr::set_default(Session *, enum_var_type)
1038
1022
*value= (bool) option_limits->def_value;
1042
bool sys_var_enum::update(Session *session __attribute__((unused)), set_var *var)
1026
bool sys_var_enum::update(Session *, set_var *var)
1044
1028
*value= (uint) var->save_result.uint32_t_value;
1049
unsigned char *sys_var_enum::value_ptr(Session *session __attribute__((unused)),
1050
enum_var_type type __attribute__((unused)),
1051
LEX_STRING *base __attribute__((unused)))
1033
unsigned char *sys_var_enum::value_ptr(Session *, enum_var_type, LEX_STRING *)
1053
1035
return (unsigned char*) enum_names->type_names[*value];
1057
unsigned char *sys_var_enum_const::value_ptr(Session *session __attribute__((unused)),
1058
enum_var_type type __attribute__((unused)),
1059
LEX_STRING *base __attribute__((unused)))
1039
unsigned char *sys_var_enum_const::value_ptr(Session *, enum_var_type,
1061
1042
return (unsigned char*) enum_names->type_names[global_system_variables.*offset];
1113
unsigned char *sys_var_session_ulong::value_ptr(Session *session, enum_var_type type,
1114
LEX_STRING *base __attribute__((unused)))
1094
unsigned char *sys_var_session_ulong::value_ptr(Session *session,
1116
1098
if (type == OPT_GLOBAL)
1117
1099
return (unsigned char*) &(global_system_variables.*offset);
1162
unsigned char *sys_var_session_ha_rows::value_ptr(Session *session, enum_var_type type,
1163
LEX_STRING *base __attribute__((unused)))
1144
unsigned char *sys_var_session_ha_rows::value_ptr(Session *session,
1165
1148
if (type == OPT_GLOBAL)
1166
1149
return (unsigned char*) &(global_system_variables.*offset);
1214
unsigned char *sys_var_session_uint64_t::value_ptr(Session *session, enum_var_type type,
1215
LEX_STRING *base __attribute__((unused)))
1197
unsigned char *sys_var_session_uint64_t::value_ptr(Session *session,
1217
1201
if (type == OPT_GLOBAL)
1218
1202
return (unsigned char*) &(global_system_variables.*offset);
1242
unsigned char *sys_var_session_bool::value_ptr(Session *session, enum_var_type type,
1243
LEX_STRING *base __attribute__((unused)))
1226
unsigned char *sys_var_session_bool::value_ptr(Session *session,
1245
1230
if (type == OPT_GLOBAL)
1246
1231
return (unsigned char*) &(global_system_variables.*offset);
1251
bool sys_var::check_enum(Session *session __attribute__((unused)),
1236
bool sys_var::check_enum(Session *,
1252
1237
set_var *var, const TYPELIB *enum_names)
1254
1239
char buff[STRING_BUFFER_USUAL_SIZE];
1285
bool sys_var::check_set(Session *session __attribute__((unused)),
1286
set_var *var, TYPELIB *enum_names)
1270
bool sys_var::check_set(Session *, set_var *var, TYPELIB *enum_names)
1289
1273
char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
1484
unsigned char *sys_var_session_enum::value_ptr(Session *session, enum_var_type type,
1485
LEX_STRING *base __attribute__((unused)))
1468
unsigned char *sys_var_session_enum::value_ptr(Session *session,
1487
1472
ulong tmp= ((type == OPT_GLOBAL) ?
1488
1473
global_system_variables.*offset :
1506
unsigned char *sys_var_session_bit::value_ptr(Session *session,
1507
enum_var_type type __attribute__((unused)),
1508
LEX_STRING *base __attribute__((unused)))
1491
unsigned char *sys_var_session_bit::value_ptr(Session *session, enum_var_type,
1511
1495
If reverse is 0 (default) return 1 if bit is set.
1604
unsigned char *sys_var_session_date_time_format::value_ptr(Session *session, enum_var_type type,
1605
LEX_STRING *base __attribute__((unused)))
1588
unsigned char *sys_var_session_date_time_format::value_ptr(Session *session,
1607
1592
if (type == OPT_GLOBAL)
1711
unsigned char *sys_var_character_set::value_ptr(Session *session, enum_var_type type,
1712
LEX_STRING *base __attribute__((unused)))
1694
unsigned char *sys_var_character_set::value_ptr(Session *session,
1714
1698
const CHARSET_INFO * const cs= ci_ptr(session,type)[0];
1715
1699
return cs ? (unsigned char*) cs->csname : (unsigned char*) NULL;
1744
unsigned char *sys_var_collation_sv::value_ptr(Session *session, enum_var_type type,
1745
LEX_STRING *base __attribute__((unused)))
1728
unsigned char *sys_var_collation_sv::value_ptr(Session *session,
1747
1732
const CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
1748
global_system_variables.*offset : session->variables.*offset);
1733
global_system_variables.*offset :
1734
session->variables.*offset);
1749
1735
return cs ? (unsigned char*) cs->name : (unsigned char*) "NULL";
1767
unsigned char *sys_var_key_cache_param::value_ptr(Session *session __attribute__((unused)),
1768
enum_var_type type __attribute__((unused)),
1769
LEX_STRING *base __attribute__((unused)))
1753
unsigned char *sys_var_key_cache_param::value_ptr(Session *, enum_var_type,
1771
1756
KEY_CACHE *key_cache= get_key_cache(base);
1772
1757
if (!key_cache)
1932
void sys_var_log_state::set_default(Session *session __attribute__((unused)),
1933
enum_var_type type __attribute__((unused)))
1917
void sys_var_log_state::set_default(Session *, enum_var_type)
1938
bool update_sys_var_str_path(Session *session __attribute__((unused)),
1939
sys_var_str *var_str,
1922
bool update_sys_var_str_path(Session *, sys_var_str *var_str,
1940
1923
set_var *var, const char *log_ext,
1941
1924
bool log_state, uint32_t log_type)
1999
void sys_var_log_output::set_default(Session *session __attribute__((unused)),
2000
enum_var_type type __attribute__((unused)))
1981
void sys_var_log_output::set_default(Session *, enum_var_type)
2002
1983
pthread_mutex_lock(&LOCK_global_system_variables);
2003
1984
logger.lock_exclusive();
2010
1991
unsigned char *sys_var_log_output::value_ptr(Session *session,
2011
enum_var_type type __attribute__((unused)),
2012
LEX_STRING *base __attribute__((unused)))
1992
enum_var_type, LEX_STRING *)
2014
1994
char buff[256];
2015
1995
String tmp(buff, sizeof(buff), &my_charset_utf8_general_ci);
2037
2017
Functions to handle SET NAMES and SET CHARACTER SET
2038
2018
*****************************************************************************/
2040
int set_var_collation_client::check(Session *session __attribute__((unused)))
2020
int set_var_collation_client::check(Session *)
2042
2022
/* Currently, UCS-2 cannot be used as a client character set */
2043
2023
if (character_set_client->mbminlen > 1)
2071
void sys_var_timestamp::set_default(Session *session,
2072
enum_var_type type __attribute__((unused)))
2051
void sys_var_timestamp::set_default(Session *session, enum_var_type)
2074
2053
session->user_time=0;
2078
unsigned char *sys_var_timestamp::value_ptr(Session *session,
2079
enum_var_type type __attribute__((unused)),
2080
LEX_STRING *base __attribute__((unused)))
2057
unsigned char *sys_var_timestamp::value_ptr(Session *session, enum_var_type,
2082
2060
session->sys_var_tmp.long_value= (long) session->start_time;
2083
2061
return (unsigned char*) &session->sys_var_tmp.long_value;
2095
2073
unsigned char *sys_var_last_insert_id::value_ptr(Session *session,
2096
enum_var_type type __attribute__((unused)),
2097
LEX_STRING *base __attribute__((unused)))
2100
2078
this tmp var makes it robust againt change of type of
2101
2079
read_first_successful_insert_id_in_prev_stmt().
2103
session->sys_var_tmp.uint64_t_value=
2081
session->sys_var_tmp.uint64_t_value=
2104
2082
session->read_first_successful_insert_id_in_prev_stmt();
2105
2083
return (unsigned char*) &session->sys_var_tmp.uint64_t_value;
2116
unsigned char *sys_var_insert_id::value_ptr(Session *session,
2117
enum_var_type type __attribute__((unused)),
2118
LEX_STRING *base __attribute__((unused)))
2094
unsigned char *sys_var_insert_id::value_ptr(Session *session, enum_var_type,
2120
2097
session->sys_var_tmp.uint64_t_value=
2121
2098
session->auto_inc_intervals_forced.minimum();
2169
unsigned char *sys_var_session_time_zone::value_ptr(Session *session, enum_var_type type,
2170
LEX_STRING *base __attribute__((unused)))
2146
unsigned char *sys_var_session_time_zone::value_ptr(Session *session,
2173
2151
We can use ptr() instead of c_ptr() here because String contaning
2174
2152
time zone name is guaranteed to be zero ended.
2232
bool sys_var_max_user_conn::update(Session *session __attribute__((unused)),
2210
bool sys_var_max_user_conn::update(Session *, set_var *var)
2235
2212
assert(var->type == OPT_GLOBAL);
2236
2213
pthread_mutex_lock(&LOCK_global_system_variables);
2243
void sys_var_max_user_conn::set_default(Session *session __attribute__((unused)),
2244
enum_var_type type __attribute__((unused)))
2220
void sys_var_max_user_conn::set_default(Session *, enum_var_type type)
2246
2222
assert(type == OPT_GLOBAL);
2247
2223
pthread_mutex_lock(&LOCK_global_system_variables);
2253
unsigned char *sys_var_max_user_conn::value_ptr(Session *session, enum_var_type type,
2254
LEX_STRING *base __attribute__((unused)))
2229
unsigned char *sys_var_max_user_conn::value_ptr(Session *session,
2256
2233
if (type != OPT_GLOBAL &&
2257
2234
session->user_connect && session->user_connect->user_resources.user_conn)
2311
2287
unsigned char *sys_var_session_lc_time_names::value_ptr(Session *session,
2313
LEX_STRING *base __attribute__((unused)))
2315
2291
return type == OPT_GLOBAL ?
2316
2292
(unsigned char *) global_system_variables.lc_time_names->name :
2373
unsigned char *sys_var_microseconds::value_ptr(Session *session, enum_var_type type,
2374
LEX_STRING *base __attribute__((unused)))
2349
unsigned char *sys_var_microseconds::value_ptr(Session *session,
2376
2353
session->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
2377
2354
global_system_variables.*offset :
2429
static int check_log_update(Session *session __attribute__((unused)),
2430
set_var *var __attribute__((unused)))
2406
static int check_log_update(Session *, set_var *)
2436
static int check_pseudo_thread_id(Session *session __attribute__((unused)),
2412
static int check_pseudo_thread_id(Session *, set_var *var)
2439
2414
var->save_result.uint64_t_value= var->value->val_int();
2524
2499
static unsigned char *get_sys_var_length(const sys_var *var, size_t *length,
2525
bool first __attribute__((unused)))
2527
2502
*length= var->name_length;
2528
2503
return (unsigned char*) var->name;
2944
unsigned char *sys_var_session_storage_engine::value_ptr(Session *session, enum_var_type type,
2945
LEX_STRING *base __attribute__((unused)))
2919
unsigned char *sys_var_session_storage_engine::value_ptr(Session *session,
2947
2923
unsigned char* result;
2948
2924
handlerton *hton;
3026
unsigned char *sys_var_session_optimizer_switch::value_ptr(Session *session, enum_var_type type,
3027
LEX_STRING *base __attribute__((unused)))
3002
unsigned char *sys_var_session_optimizer_switch::value_ptr(Session *session,
3029
3006
LEX_STRING opts;
3030
3007
uint64_t val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :