mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge
include/my_base.h: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged isam/test2.c: Auto merged myisam/mi_check.c: Auto merged myisam/mi_test2.c: Auto merged myisam/myisamchk.c: Auto merged myisam/myisamdef.h: Auto merged mysql-test/r/func_group.result: Auto merged sql/ha_myisam.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item_cmpfunc.h: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/set_var.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_test.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/mysqld.cc: SCCS merged sql/set_var.cc: SCCS merged
This commit is contained in:
@@ -736,6 +736,11 @@ int handler::analyze(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int handler::assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int handler::preload_keys(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
@@ -1102,27 +1107,62 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
|
||||
|
||||
/* Use key cacheing on all databases */
|
||||
|
||||
void ha_key_cache(void)
|
||||
int ha_key_cache(KEY_CACHE_VAR *key_cache)
|
||||
{
|
||||
/*
|
||||
The following mutex is not really needed as long as keybuff_size is
|
||||
treated as a long value, but we use the mutex here to guard for future
|
||||
changes.
|
||||
*/
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
long tmp= (long) keybuff_size;
|
||||
pthread_mutex_unlock(&LOCK_global_system_variables);
|
||||
if (tmp)
|
||||
(void) init_key_cache(tmp);
|
||||
if (!key_cache->cache)
|
||||
{
|
||||
/*
|
||||
The following mutex is not really needed as long as keybuff_size is
|
||||
treated as a long value, but we use the mutex here to guard for future
|
||||
changes.
|
||||
*/
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
if (!key_cache->block_size)
|
||||
key_cache->block_size= dflt_key_cache_block_size;
|
||||
if (!key_cache->buff_size)
|
||||
key_cache->buff_size= dflt_key_buff_size;
|
||||
long tmp_buff_size= (long) key_cache->buff_size;
|
||||
long tmp_block_size= (long) key_cache->block_size;
|
||||
pthread_mutex_unlock(&LOCK_global_system_variables);
|
||||
return !init_key_cache(&key_cache->cache,
|
||||
tmp_block_size,
|
||||
tmp_buff_size,
|
||||
key_cache);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void ha_resize_key_cache(void)
|
||||
int ha_resize_key_cache(KEY_CACHE_VAR *key_cache)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
long tmp= (long) keybuff_size;
|
||||
pthread_mutex_unlock(&LOCK_global_system_variables);
|
||||
(void) resize_key_cache(tmp);
|
||||
if (key_cache->cache)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
long tmp_buff_size= (long) key_cache->buff_size;
|
||||
long tmp_block_size= (long) key_cache->block_size;
|
||||
pthread_mutex_unlock(&LOCK_global_system_variables);
|
||||
return !resize_key_cache(&key_cache->cache, tmp_block_size,
|
||||
tmp_buff_size);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ha_change_key_cache_param(KEY_CACHE_VAR *key_cache)
|
||||
{
|
||||
if (key_cache->cache)
|
||||
{
|
||||
change_key_cache_param(key_cache->cache);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ha_end_key_cache(KEY_CACHE_VAR *key_cache)
|
||||
{
|
||||
if (key_cache->cache)
|
||||
{
|
||||
end_key_cache(&key_cache->cache, 1);
|
||||
return key_cache->cache ? 1 : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user