MySQL 5.6.14 Source Code Document
|
#include "univ.i"
#include "hash0hash.h"
#include "page0types.h"
#include "buf0types.h"
#include "rem0types.h"
#include "ha0ha.ic"
Go to the source code of this file.
Classes | |
struct | ha_node_t |
Macros | |
#define | ha_search_and_update_if_found(table, fold, data, new_block, new_data) ha_search_and_update_if_found_func(table,fold,data,new_data) |
#define | ha_create(n_c, n_m, type, level) ha_create_func(n_c,n_m,type) |
#define | ha_insert_for_fold(t, f, b, d) |
#define | hash_assert_can_modify(t, f) |
#define | hash_assert_can_search(t, f) |
Functions | |
UNIV_INLINE const rec_t * | ha_search_and_get_data (hash_table_t *table, ulint fold) |
UNIV_INTERN ibool | ha_search_and_update_if_found_func (hash_table_t *table, ulint fold, const rec_t *data, const rec_t *new_data) |
UNIV_INTERN hash_table_t * | ha_create_func (ulint n, ulint n_mutexes, ulint type) |
UNIV_INTERN void | ha_clear (hash_table_t *table) |
UNIV_INTERN ibool | ha_insert_for_fold_func (hash_table_t *table, ulint fold, const rec_t *data) |
UNIV_INLINE ibool | ha_search_and_delete_if_found (hash_table_t *table, ulint fold, const rec_t *data) |
UNIV_INTERN void | ha_remove_all_nodes_to_page (hash_table_t *table, ulint fold, const page_t *page) |
UNIV_INTERN void | ha_print_info (FILE *file, hash_table_t *table) |
#define ha_create | ( | n_c, | |
n_m, | |||
type, | |||
level | |||
) | ha_create_func(n_c,n_m,type) |
Creates a hash table.
n_c | in: number of array cells. The actual number of cells is chosen to be a slightly bigger prime number. |
level | in: level of the mutexes in the latching order |
n_m | in: number of mutexes to protect the hash table; must be a power of 2, or 0 |
#define ha_insert_for_fold | ( | t, | |
f, | |||
b, | |||
d | |||
) |
Inserts an entry into a hash table. If an entry with the same fold number is found, its node is updated to point to the new data, and no new node is inserted.
t | in: hash table |
f | in: folded value of data |
b | ignored: buffer block containing the data |
d | in: data, must not be NULL |
#define ha_search_and_update_if_found | ( | table, | |
fold, | |||
data, | |||
new_block, | |||
new_data | |||
) | ha_search_and_update_if_found_func(table,fold,data,new_data) |
Looks for an element when we know the pointer to the data and
updates the pointer to data if found.
table | in/out: hash table |
fold | in: folded value of the searched data |
data | in: pointer to the data |
new_block | ignored: block containing new_data |
new_data | in: new pointer to the data |
UNIV_INTERN void ha_clear | ( | hash_table_t * | table | ) |
UNIV_INTERN hash_table_t* ha_create_func | ( | ulint | n, |
ulint | n_sync_obj, | ||
ulint | type | ||
) |
Creates a hash table with at least n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n.
Creates a hash table with at least n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n.
n | in: number of array cells |
n_sync_obj | in: number of mutexes or rw_locks to protect the hash table: must be a power of 2, or 0 |
type | in: type of datastructure for which the memory heap is going to be used e.g.: MEM_HEAP_FOR_BTR_SEARCH or MEM_HEAP_FOR_PAGE_HASH |
Definition at line 44 of file ha0ha.cc.
UNIV_INTERN ibool ha_insert_for_fold_func | ( | hash_table_t * | table, |
ulint | fold, | ||
const rec_t * | data | ||
) |
Inserts an entry into a hash table. If an entry with the same fold number is found, its node is updated to point to the new data, and no new node is inserted.
Inserts an entry into a hash table. If an entry with the same fold number is found, its node is updated to point to the new data, and no new node is inserted. If btr_search_enabled is set to FALSE, we will only allow updating existing nodes, but no new node is allowed to be added.
table | in: hash table |
fold | in: folded value of data; if a node with the same fold value already exists, it is updated to point to the same data, and no new node is created! |
data | in: data, must not be NULL |
Definition at line 166 of file ha0ha.cc.
UNIV_INTERN void ha_print_info | ( | FILE * | file, |
hash_table_t * | table | ||
) |
UNIV_INTERN void ha_remove_all_nodes_to_page | ( | hash_table_t * | table, |
ulint | fold, | ||
const page_t * | page | ||
) |
Removes from the chain determined by fold all nodes whose data pointer points to the page given. in: buffer page
Removes from the chain determined by fold all nodes whose data pointer points to the page given.
table | in: hash table |
fold | in: fold value |
page | in: buffer page |
Definition at line 348 of file ha0ha.cc.
UNIV_INLINE ibool ha_search_and_delete_if_found | ( | hash_table_t * | table, |
ulint | fold, | ||
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.
table | in: hash table |
fold | in: folded value of the searched data |
UNIV_INLINE const rec_t* ha_search_and_get_data | ( | hash_table_t * | table, |
ulint | fold | ||
) |
Looks for an element in a hash table.
table | in: hash table |
UNIV_INTERN ibool ha_search_and_update_if_found_func | ( | hash_table_t * | table, |
ulint | fold, | ||
const rec_t * | data, | ||
const rec_t * | new_data | ||
) |
Looks for an element when we know the pointer to the data and updates the pointer to data if found.
Looks for an element when we know the pointer to the data, and updates the pointer to data, if found.
table | in/out: hash table |
fold | in: folded value of the searched data |
data | in: pointer to the data |
new_data | in: new pointer to the data |
Definition at line 297 of file ha0ha.cc.