diff options
author | monty@narttu.mysql.fi <> | 2003-08-17 14:10:15 +0300 |
---|---|---|
committer | monty@narttu.mysql.fi <> | 2003-08-17 14:10:15 +0300 |
commit | d79cbc3b995c22885c24ee0773c6e4e27a5b6ec3 (patch) | |
tree | 87feb8f1e2709918215eaa5b5031a4a243ba4531 /sql/set_var.cc | |
parent | fe511fc48921708ea37604fefd8b84da182e73fe (diff) | |
download | mariadb-git-d79cbc3b995c22885c24ee0773c6e4e27a5b6ec3.tar.gz |
Fix mutex handling in SHOW_VARIABLES (key_buffer_size was not properly protected)
Changed some non fatal myisamchk error messages to warnings
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index b3238d1c0ec..6dc36e312cb 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -729,10 +729,12 @@ void fix_max_relay_log_size(THD *thd, enum_var_type type) bool sys_var_long_ptr::update(THD *thd, set_var *var) { ulonglong tmp= var->value->val_int(); + pthread_mutex_lock(&LOCK_global_system_variables); if (option_limits) *value= (ulong) getopt_ull_limit_value(tmp, option_limits); else *value= (ulong) tmp; + pthread_mutex_unlock(&LOCK_global_system_variables); return 0; } @@ -746,17 +748,21 @@ void sys_var_long_ptr::set_default(THD *thd, enum_var_type type) bool sys_var_ulonglong_ptr::update(THD *thd, set_var *var) { ulonglong tmp= var->value->val_int(); + pthread_mutex_lock(&LOCK_global_system_variables); if (option_limits) *value= (ulonglong) getopt_ull_limit_value(tmp, option_limits); else *value= (ulonglong) tmp; + pthread_mutex_unlock(&LOCK_global_system_variables); return 0; } void sys_var_ulonglong_ptr::set_default(THD *thd, enum_var_type type) { + pthread_mutex_lock(&LOCK_global_system_variables); *value= (ulonglong) option_limits->def_value; + pthread_mutex_unlock(&LOCK_global_system_variables); } @@ -1000,9 +1006,21 @@ Item *sys_var::item(THD *thd, enum_var_type var_type) case SHOW_LONG: return new Item_uint((int32) *(ulong*) value_ptr(thd, var_type)); case SHOW_LONGLONG: - return new Item_int(*(longlong*) value_ptr(thd, var_type)); + { + longlong value; + pthread_mutex_lock(&LOCK_global_system_variables); + value= *(longlong*) value_ptr(thd, var_type); + pthread_mutex_unlock(&LOCK_global_system_variables); + return new Item_int(value); + } case SHOW_HA_ROWS: - return new Item_int((longlong) *(ha_rows*) value_ptr(thd, var_type)); + { + ha_rows value; + pthread_mutex_lock(&LOCK_global_system_variables); + value= *(ha_rows*) value_ptr(thd, var_type); + pthread_mutex_unlock(&LOCK_global_system_variables); + return new Item_int((longlong) value); + } case SHOW_MY_BOOL: return new Item_int((int32) *(my_bool*) value_ptr(thd, var_type),1); case SHOW_CHAR: |