diff options
author | serg@janus.mylan <> | 2007-12-19 21:31:04 +0100 |
---|---|---|
committer | serg@janus.mylan <> | 2007-12-19 21:31:04 +0100 |
commit | 4a5eb6bd17c56fe76c5cbfd216ea4624d979614f (patch) | |
tree | 0ed7873673248c5a8de230d38d1130699a225bc6 /sql/set_var.cc | |
parent | 4bb503568dc598d1e16fead04c9cebc4e78725df (diff) | |
download | mariadb-git-4a5eb6bd17c56fe76c5cbfd216ea4624d979614f.tar.gz |
correct invalid values in SET GLOBAL var=DEFAULT
bug#33382
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index d0362edaa29..4cb6b836c39 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -113,8 +113,7 @@ static int check_max_delayed_threads(THD *thd, set_var *var); static void fix_thd_mem_root(THD *thd, enum_var_type type); static void fix_trans_mem_root(THD *thd, enum_var_type type); static void fix_server_id(THD *thd, enum_var_type type); -static ulonglong fix_unsigned(THD *thd, ulonglong num, - const struct my_option *option_limits); +static ulonglong fix_unsigned(THD *, ulonglong, const struct my_option *); static bool get_unsigned(THD *thd, set_var *var); static void throw_bounds_warning(THD *thd, const char *name, ulonglong num); static KEY_CACHE *create_key_cache(const char *name, uint length); @@ -1524,8 +1523,10 @@ bool sys_var_long_ptr_global::update(THD *thd, set_var *var) void sys_var_long_ptr_global::set_default(THD *thd, enum_var_type type) { + bool not_used; pthread_mutex_lock(guard); - *value= (ulong) option_limits->def_value; + *value= (ulong) getopt_ull_limit_value((ulong) option_limits->def_value, + option_limits, ¬_used); pthread_mutex_unlock(guard); } @@ -1545,8 +1546,10 @@ bool sys_var_ulonglong_ptr::update(THD *thd, set_var *var) void sys_var_ulonglong_ptr::set_default(THD *thd, enum_var_type type) { + bool not_used; pthread_mutex_lock(&LOCK_global_system_variables); - *value= (ulonglong) option_limits->def_value; + *value= getopt_ull_limit_value((ulonglong) option_limits->def_value, + option_limits, ¬_used); pthread_mutex_unlock(&LOCK_global_system_variables); } @@ -1616,8 +1619,11 @@ void sys_var_thd_ulong::set_default(THD *thd, enum_var_type type) { if (type == OPT_GLOBAL) { + bool not_used; /* We will not come here if option_limits is not set */ - global_system_variables.*offset= (ulong) option_limits->def_value; + global_system_variables.*offset= + getopt_ull_limit_value((ulong) option_limits->def_value, + option_limits, ¬_used); } else thd->variables.*offset= global_system_variables.*offset; @@ -1660,9 +1666,12 @@ void sys_var_thd_ha_rows::set_default(THD *thd, enum_var_type type) { if (type == OPT_GLOBAL) { + bool not_used; /* We will not come here if option_limits is not set */ pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.*offset= (ha_rows) option_limits->def_value; + global_system_variables.*offset= + (ha_rows) getopt_ull_limit_value((ha_rows) option_limits->def_value, + option_limits, ¬_used); pthread_mutex_unlock(&LOCK_global_system_variables); } else @@ -1709,8 +1718,11 @@ void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type) { if (type == OPT_GLOBAL) { + bool not_used; pthread_mutex_lock(&LOCK_global_system_variables); - global_system_variables.*offset= (ulonglong) option_limits->def_value; + global_system_variables.*offset= + getopt_ull_limit_value((ulonglong) option_limits->def_value, + option_limits, ¬_used); pthread_mutex_unlock(&LOCK_global_system_variables); } else |