49
49
#include "../storage/perfschema/pfs_server.h"
50
50
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
52
TYPELIB bool_typelib={ array_elements(bool_values)-1, "", bool_values, 0 };
53
55
This forward declaration is needed because including sql_base.h
54
56
causes further includes. [TODO] Eliminate this forward declaration
57
59
extern void close_thread_tables(THD *thd);
62
static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache,
63
ptrdiff_t offset, ulonglong new_value)
66
DBUG_ASSERT(offset == offsetof(KEY_CACHE, param_buff_size));
70
if (key_cache == dflt_key_cache)
72
my_error(ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, MYF(0));
76
if (key_cache->key_cache_inited) // If initied
79
Move tables using this key cache to the default key cache
80
and clear the old key cache.
82
key_cache->in_init= 1;
83
mysql_mutex_unlock(&LOCK_global_system_variables);
84
key_cache->param_buff_size= 0;
85
ha_resize_key_cache(key_cache);
86
ha_change_key_cache(key_cache, dflt_key_cache);
88
We don't delete the key cache as some running threads my still be in
89
the key cache code with a pointer to the deleted (empty) key cache
91
mysql_mutex_lock(&LOCK_global_system_variables);
92
key_cache->in_init= 0;
97
key_cache->param_buff_size= new_value;
99
/* If key cache didn't exist initialize it, else resize it */
100
key_cache->in_init= 1;
101
mysql_mutex_unlock(&LOCK_global_system_variables);
103
if (!key_cache->key_cache_inited)
104
error= ha_init_key_cache(0, key_cache);
106
error= ha_resize_key_cache(key_cache);
108
mysql_mutex_lock(&LOCK_global_system_variables);
109
key_cache->in_init= 0;
114
static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache,
115
ptrdiff_t offset, ulonglong new_value)
118
DBUG_ASSERT(offset != offsetof(KEY_CACHE, param_buff_size));
120
keycache_var(key_cache, offset)= new_value;
122
key_cache->in_init= 1;
123
mysql_mutex_unlock(&LOCK_global_system_variables);
124
error= ha_resize_key_cache(key_cache);
126
mysql_mutex_lock(&LOCK_global_system_variables);
127
key_cache->in_init= 0;
60
133
The rule for this file: everything should be 'static'. When a sys_var
61
134
variable or a function from this file is - in very rare cases - needed
1156
1229
VALID_RANGE(16384, (ulonglong)~(intptr)0), DEFAULT(16*1024*1024),
1157
1230
BLOCK_SIZE(1024));
1232
static Sys_var_ulong Sys_metadata_locks_cache_size(
1233
"metadata_locks_cache_size", "Size of unused metadata locks cache",
1234
READ_ONLY GLOBAL_VAR(mdl_locks_cache_size), CMD_LINE(REQUIRED_ARG),
1235
VALID_RANGE(1, 1024*1024), DEFAULT(MDL_LOCKS_CACHE_SIZE_DEFAULT),
1159
1238
static Sys_var_ulong Sys_pseudo_thread_id(
1160
1239
"pseudo_thread_id",
1161
1240
"This variable is for internal server use",
3174
3253
SESSION_VAR(time_zone), NO_CMD_LINE,
3175
3254
DEFAULT(&default_tz), NO_MUTEX_GUARD, IN_BINLOG);
3257
/****************************************************************************
3259
****************************************************************************/
3261
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
3262
template class List<set_var_base>;
3263
template class List_iterator_fast<set_var_base>;
3264
template class Sys_var_unsigned<uint, GET_UINT, SHOW_INT>;
3265
template class Sys_var_unsigned<ulong, GET_ULONG, SHOW_LONG>;
3266
template class Sys_var_unsigned<ha_rows, GET_HA_ROWS, SHOW_HA_ROWS>;
3267
template class Sys_var_unsigned<ulonglong, GET_ULL, SHOW_LONGLONG>;