MySQL 8.4.0
Source Code Documentation
ha0ha.ic File Reference

The hash table with external chains. More...

#include "btr0types.h"
#include "mem0mem.h"
#include "ut0rnd.h"

Functions

void ha_delete_hash_node (hash_table_t *table, ha_node_t *del_node)
 Deletes a hash node. More...
 
static const rec_tha_node_get_data (const ha_node_t *node)
 Gets a hash node data. More...
 
static void ha_node_set_data (ha_node_t *node, buf_block_t *block, const rec_t *data)
 Sets hash node data. More...
 
static ha_node_tha_chain_get_next (const ha_node_t *node)
 Gets the next node in a hash chain. More...
 
static ha_node_tha_chain_get_first (hash_table_t *table, uint64_t hash_value)
 Gets the first node in a hash chain. More...
 
static const rec_tha_search_and_get_data (hash_table_t *table, uint64_t hash_value)
 Looks for an element in a hash table. More...
 
static ha_node_tha_search_with_data (hash_table_t *table, uint64_t hash_value, const rec_t *data)
 Looks for an element when we know the pointer to the data. More...
 
static bool ha_search_and_delete_if_found (hash_table_t *table, uint64_t hash_value, const rec_t *data)
 Looks for an element when we know the pointer to the data, and deletes it from the hash table, if found. More...
 

Detailed Description

The hash table with external chains.

Created 8/18/1994 Heikki Tuuri

Function Documentation

◆ ha_chain_get_first()

static ha_node_t * ha_chain_get_first ( hash_table_t table,
uint64_t  hash_value 
)
inlinestatic

Gets the first node in a hash chain.

Returns
first node, NULL if none
Parameters
tablein: hash table
hash_valuein: hash value determining the chain

◆ ha_chain_get_next()

static ha_node_t * ha_chain_get_next ( const ha_node_t node)
inlinestatic

Gets the next node in a hash chain.

Returns
next node, NULL if none
Parameters
nodein: hash chain node

◆ ha_delete_hash_node()

void ha_delete_hash_node ( hash_table_t table,
ha_node_t del_node 
)

Deletes a hash node.

in: node to be deleted

Parameters
tablein: hash table
del_nodein: node to be deleted

◆ ha_node_get_data()

static const rec_t * ha_node_get_data ( const ha_node_t node)
inlinestatic

Gets a hash node data.

Returns
pointer to the data
Parameters
nodein: hash chain node

◆ ha_node_set_data()

static void ha_node_set_data ( ha_node_t node,
buf_block_t block,
const rec_t data 
)
inlinestatic

Sets hash node data.

Parameters
[in]nodechain node
[in]blockbuffer block containing the data
[in]datapointer to the data

◆ ha_search_and_delete_if_found()

static bool ha_search_and_delete_if_found ( hash_table_t table,
uint64_t  hash_value,
const rec_t data 
)
inlinestatic

Looks for an element when we know the pointer to the data, and deletes it from the hash table, if found.

Returns
true if found
Parameters
tablein: hash table
hash_valuein: hashed value of the searched data
datain: pointer to the data

◆ ha_search_and_get_data()

static const rec_t * ha_search_and_get_data ( hash_table_t table,
uint64_t  hash_value 
)
inlinestatic

Looks for an element in a hash table.

Returns
pointer to the data of the first hash table node in chain having the hash number, NULL if not found
Parameters
tablein: hash table
hash_valuein: hashed value of the searched data

◆ ha_search_with_data()

static ha_node_t * ha_search_with_data ( hash_table_t table,
uint64_t  hash_value,
const rec_t data 
)
inlinestatic

Looks for an element when we know the pointer to the data.

Returns
pointer to the hash table node, NULL if not found in the table
Parameters
tablein: hash table
hash_valuein: hashed value of the searched data
datain: pointer to the data