MySQL 9.1.0
Source Code Documentation
mf_keycaches.cc File Reference

Handling of multiple key caches. More...

#include <string.h>
#include <sys/types.h>
#include <string>
#include "keycache.h"
#include "map_helpers.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "mysql/psi/mysql_rwlock.h"
#include "mysql/service_mysql_alloc.h"
#include "mysql/strings/m_ctype.h"
#include "mysys/mysys_priv.h"
#include "template_utils.h"

Classes

struct  SAFE_HASH_ENTRY
 
struct  SAFE_HASH
 

Functions

static bool safe_hash_init (SAFE_HASH *hash, uchar *default_value)
 
static void safe_hash_free (SAFE_HASH *hash)
 
static ucharsafe_hash_search (SAFE_HASH *hash, const uchar *key, uint length)
 
static bool safe_hash_set (SAFE_HASH *hash, const uchar *key, uint length, uchar *data)
 
static void safe_hash_change (SAFE_HASH *hash, uchar *old_data, uchar *new_data)
 
bool multi_keycache_init (void)
 
void multi_keycache_free (void)
 
KEY_CACHEmulti_key_cache_search (uchar *key, uint length)
 
bool multi_key_cache_set (const uchar *key, uint length, KEY_CACHE *key_cache)
 
void multi_key_cache_change (KEY_CACHE *old_data, KEY_CACHE *new_data)
 

Variables

static SAFE_HASH key_cache_hash
 

Detailed Description

Handling of multiple key caches.

The idea is to have a thread safe hash on the table name, with a default key cache value that is returned if the table name is not in the cache.

Function Documentation

◆ multi_key_cache_change()

void multi_key_cache_change ( KEY_CACHE old_data,
KEY_CACHE new_data 
)

◆ multi_key_cache_search()

KEY_CACHE * multi_key_cache_search ( uchar key,
uint  length 
)

◆ multi_key_cache_set()

bool multi_key_cache_set ( const uchar key,
uint  length,
KEY_CACHE key_cache 
)

◆ multi_keycache_free()

void multi_keycache_free ( void  )

◆ multi_keycache_init()

bool multi_keycache_init ( void  )

◆ safe_hash_change()

static void safe_hash_change ( SAFE_HASH hash,
uchar old_data,
uchar new_data 
)
static

◆ safe_hash_free()

static void safe_hash_free ( SAFE_HASH hash)
static

◆ safe_hash_init()

static bool safe_hash_init ( SAFE_HASH hash,
uchar default_value 
)
static

◆ safe_hash_search()

static uchar * safe_hash_search ( SAFE_HASH hash,
const uchar key,
uint  length 
)
static

◆ safe_hash_set()

static bool safe_hash_set ( SAFE_HASH hash,
const uchar key,
uint  length,
uchar data 
)
static

Variable Documentation

◆ key_cache_hash

SAFE_HASH key_cache_hash
static