summaryrefslogtreecommitdiff
path: root/sql/sys_vars.h
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2011-12-02 14:16:48 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2011-12-02 14:16:48 +0100
commitb522a6ce78bfe7bea3e52715c993c7d190159139 (patch)
tree9e4c9211a159f15e7bd8ab5ca489f53fd8b28a7c /sql/sys_vars.h
parent8e6d41e278de3264d2a6e13cbc0ed328afca7f40 (diff)
downloadmariadb-git-b522a6ce78bfe7bea3e52715c993c7d190159139.tar.gz
Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS
handle_segfault is the signal handler code of mysqld. however, it makes calls to potentially unsafe functions localtime_r, fprintf, fflush. include/my_stacktrace.h: Add safe versions of itoa() write() and snprintf(). libmysqld/CMakeLists.txt: Move signal handler to separate file. mysys/stacktrace.c: Remove unsafe function calls. sql/CMakeLists.txt: Move signal handler to separate file. sql/mysqld.cc: Move signal handler to separate file. sql/set_var.h: Add missing #include dependency. sql/sys_vars.cc: Cleanup .h and .cc files. sql/sys_vars.h: Cleanup .h and .cc files.
Diffstat (limited to 'sql/sys_vars.h')
-rw-r--r--sql/sys_vars.h71
1 files changed, 0 insertions, 71 deletions
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
index 14d99407f37..98ff5f9fa02 100644
--- a/sql/sys_vars.h
+++ b/sql/sys_vars.h
@@ -72,7 +72,6 @@
enum charset_enum {IN_SYSTEM_CHARSET, IN_FS_CHARSET};
static const char *bool_values[3]= {"OFF", "ON", 0};
-TYPELIB bool_typelib={ array_elements(bool_values)-1, "", bool_values, 0 };
/**
A small wrapper class to pass getopt arguments as a pair
@@ -710,76 +709,6 @@ public:
}
};
-static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache,
- ptrdiff_t offset, ulonglong new_value)
-{
- bool error= false;
- DBUG_ASSERT(offset == offsetof(KEY_CACHE, param_buff_size));
-
- if (new_value == 0)
- {
- if (key_cache == dflt_key_cache)
- {
- my_error(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, MYF(0));
- return true;
- }
-
- if (key_cache->key_cache_inited) // If initied
- {
- /*
- Move tables using this key cache to the default key cache
- and clear the old key cache.
- */
- key_cache->in_init= 1;
- mysql_mutex_unlock(&LOCK_global_system_variables);
- key_cache->param_buff_size= 0;
- ha_resize_key_cache(key_cache);
- ha_change_key_cache(key_cache, dflt_key_cache);
- /*
- We don't delete the key cache as some running threads my still be in
- the key cache code with a pointer to the deleted (empty) key cache
- */
- mysql_mutex_lock(&LOCK_global_system_variables);
- key_cache->in_init= 0;
- }
- return error;
- }
-
- key_cache->param_buff_size= new_value;
-
- /* If key cache didn't exist initialize it, else resize it */
- key_cache->in_init= 1;
- mysql_mutex_unlock(&LOCK_global_system_variables);
-
- if (!key_cache->key_cache_inited)
- error= ha_init_key_cache(0, key_cache);
- else
- error= ha_resize_key_cache(key_cache);
-
- mysql_mutex_lock(&LOCK_global_system_variables);
- key_cache->in_init= 0;
-
- return error;
-}
-
-static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache,
- ptrdiff_t offset, ulonglong new_value)
-{
- bool error= false;
- DBUG_ASSERT(offset != offsetof(KEY_CACHE, param_buff_size));
-
- keycache_var(key_cache, offset)= new_value;
-
- key_cache->in_init= 1;
- mysql_mutex_unlock(&LOCK_global_system_variables);
- error= ha_resize_key_cache(key_cache);
-
- mysql_mutex_lock(&LOCK_global_system_variables);
- key_cache->in_init= 0;
-
- return error;
-}
-
/**
The class for floating point variables