mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria.bak
into desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-test include/maria.h: Auto merged mysys/Makefile.am: Auto merged mysys/mf_keycaches.c: Auto merged sql/handler.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged storage/maria/Makefile.am: Auto merged storage/maria/ha_maria.cc: Auto merged storage/maria/ma_bitmap.c: Auto merged storage/maria/ma_check.c: Auto merged storage/maria/ma_close.c: Auto merged storage/maria/ma_dynrec.c: Auto merged storage/maria/ma_extra.c: Auto merged storage/maria/ma_info.c: Auto merged storage/maria/ma_keycache.c: Auto merged storage/maria/ma_locking.c: Auto merged storage/maria/ma_loghandler.c: Auto merged storage/maria/ma_open.c: Auto merged storage/maria/ma_packrec.c: Auto merged storage/maria/ma_page.c: Auto merged storage/maria/ma_pagecache.c: Auto merged storage/maria/ma_panic.c: Auto merged storage/maria/ma_preload.c: Auto merged storage/maria/ma_static.c: Auto merged storage/maria/ma_test1.c: Auto merged storage/maria/ma_test2.c: Auto merged storage/maria/ma_test3.c: Auto merged storage/maria/ma_write.c: Auto merged storage/maria/maria_chk.c: Auto merged storage/maria/maria_def.h: Auto merged storage/maria/maria_ftdump.c: Auto merged storage/maria/maria_pack.c: Auto merged sql/handler.cc: merge storage/maria/ma_blockrec.c: merge storage/maria/ma_delete_all.c: merge
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
#include <myisampack.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef WITH_MARIA_STORAGE_ENGINE
|
||||
#include <maria.h>
|
||||
#endif
|
||||
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
#include "ha_partition.h"
|
||||
#endif
|
||||
@@ -2769,6 +2773,99 @@ int ha_change_key_cache(KEY_CACHE *old_key_cache,
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
pagecache handling.
|
||||
|
||||
This code is only relevant for maria tables
|
||||
|
||||
pagecache->cache may be 0 only in the case where a key cache is not
|
||||
initialized or when we where not able to init the key cache in a previous
|
||||
call to ha_init_pagecache() (probably out of memory)
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#ifdef WITH_MARIA_STORAGE_ENGINE
|
||||
|
||||
/* Init a pagecache if it has not been initied before */
|
||||
|
||||
int ha_init_pagecache(const char *name, PAGECACHE *pagecache)
|
||||
{
|
||||
DBUG_ENTER("ha_init_key_cache");
|
||||
|
||||
if (!pagecache->inited)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
long tmp_buff_size= (long) pagecache->param_buff_size;
|
||||
long tmp_block_size= (long) pagecache->param_block_size;
|
||||
uint division_limit= pagecache->param_division_limit;
|
||||
uint age_threshold= pagecache->param_age_threshold;
|
||||
pthread_mutex_unlock(&LOCK_global_system_variables);
|
||||
DBUG_RETURN(!init_pagecache(pagecache,
|
||||
tmp_buff_size, division_limit, age_threshold,
|
||||
tmp_block_size));
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
/* Resize key cache */
|
||||
/*
|
||||
TODO: uncomment when resize will be implemented
|
||||
int ha_resize_pagecache(PAGECACHE *pagecache)
|
||||
{
|
||||
DBUG_ENTER("ha_resize_pagecache");
|
||||
|
||||
if (pagecache->inited)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
long tmp_buff_size= (long) pagecache->param_buff_size;
|
||||
long tmp_block_size= (long) pagecache->param_block_size;
|
||||
uint division_limit= pagecache->param_division_limit;
|
||||
uint age_threshold= pagecache->param_age_threshold;
|
||||
pthread_mutex_unlock(&LOCK_global_system_variables);
|
||||
DBUG_RETURN(!resize_pagecache(pagecache, tmp_block_size,
|
||||
tmp_buff_size,
|
||||
division_limit, age_threshold));
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/* Change parameters for key cache (like size) */
|
||||
|
||||
int ha_change_pagecache_param(PAGECACHE *pagecache)
|
||||
{
|
||||
if (pagecache->inited)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
uint division_limit= pagecache->param_division_limit;
|
||||
uint age_threshold= pagecache->param_age_threshold;
|
||||
pthread_mutex_unlock(&LOCK_global_system_variables);
|
||||
change_pagecache_param(pagecache, division_limit, age_threshold);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Free memory allocated by a key cache */
|
||||
|
||||
int ha_end_pagecache(PAGECACHE *pagecache)
|
||||
{
|
||||
end_pagecache(pagecache, 1); // Can never fail
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Move all tables from one key cache to another one */
|
||||
|
||||
int ha_change_pagecache(PAGECACHE *old_pagecache,
|
||||
PAGECACHE *new_pagecache)
|
||||
{
|
||||
maria_change_pagecache(old_pagecache, new_pagecache);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* WITH_MARIA_STORAGE_ENGINE */
|
||||
|
||||
/** @brief
|
||||
Try to discover one table from handler(s)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user