2107
2107
use_frm= false;
2111
/*****************************************************************************
2114
This code is only relevant for ISAM/MyISAM tables
2116
key_cache->cache may be 0 only in the case where a key cache is not
2117
initialized or when we where not able to init the key cache in a previous
2118
call to ha_init_key_cache() (probably out of memory)
2119
*****************************************************************************/
2122
Init a key cache if it has not been initied before.
2124
int ha_init_key_cache(const char *,
2125
KEY_CACHE *key_cache)
2127
if (!key_cache->key_cache_inited)
2129
pthread_mutex_lock(&LOCK_global_system_variables);
2130
uint32_t tmp_buff_size= (uint32_t) key_cache->param_buff_size;
2131
uint32_t tmp_block_size= (uint32_t) key_cache->param_block_size;
2132
uint32_t division_limit= key_cache->param_division_limit;
2133
uint32_t age_threshold= key_cache->param_age_threshold;
2134
pthread_mutex_unlock(&LOCK_global_system_variables);
2135
return(!init_key_cache(key_cache,
2138
division_limit, age_threshold));
2147
int ha_resize_key_cache(KEY_CACHE *key_cache)
2149
if (key_cache->key_cache_inited)
2151
pthread_mutex_lock(&LOCK_global_system_variables);
2152
long tmp_buff_size= (long) key_cache->param_buff_size;
2153
long tmp_block_size= (long) key_cache->param_block_size;
2154
uint32_t division_limit= key_cache->param_division_limit;
2155
uint32_t age_threshold= key_cache->param_age_threshold;
2156
pthread_mutex_unlock(&LOCK_global_system_variables);
2157
return(!resize_key_cache(key_cache, tmp_block_size,
2159
division_limit, age_threshold));
2166
Change parameters for key cache (like size)
2168
int ha_change_key_cache_param(KEY_CACHE *key_cache)
2170
if (key_cache->key_cache_inited)
2172
pthread_mutex_lock(&LOCK_global_system_variables);
2173
uint32_t division_limit= key_cache->param_division_limit;
2174
uint32_t age_threshold= key_cache->param_age_threshold;
2175
pthread_mutex_unlock(&LOCK_global_system_variables);
2176
change_key_cache_param(key_cache, division_limit, age_threshold);
2182
Free memory allocated by a key cache.
2184
int ha_end_key_cache(KEY_CACHE *key_cache)
2186
end_key_cache(key_cache, 1); // Can never fail
2191
Move all tables from one key cache to another one.
2193
int ha_change_key_cache(KEY_CACHE *old_key_cache,
2194
KEY_CACHE *new_key_cache)
2196
mi_change_key_cache(old_key_cache, new_key_cache);
2202
2111
Calculate cost of 'index only' scan for given index and number of records