46 #ifdef UNIV_SYNC_DEBUG
54 #ifndef UNIV_HOTBACKUP
61 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
62 # ifndef UNIV_HOTBACKUP
63 table->adaptive = TRUE;
71 ut_min(4096, MEM_MAX_ALLOC_IN_BUF));
77 #ifndef UNIV_HOTBACKUP
78 hash_create_mutexes(table, n_mutexes, mutex_level);
82 for (i = 0; i < n_mutexes; i++) {
103 ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
104 #ifdef UNIV_SYNC_DEBUG
108 #ifndef UNIV_HOTBACKUP
110 n = table->n_mutexes;
112 for (i = 0; i < n; i++) {
120 for (i = 0; i < n; i++) {
140 #
if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
152 ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
153 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
164 while (prev_node != NULL) {
165 if (prev_node->
fold == fold) {
166 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
167 # ifndef UNIV_HOTBACKUP
168 if (table->adaptive) {
172 ut_a(prev_block->n_pointers > 0);
173 prev_block->n_pointers--;
179 prev_node->block = block;
181 prev_node->
data = data;
186 prev_node = prev_node->
next;
209 ha_node_set_data(node, block, data);
211 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
212 # ifndef UNIV_HOTBACKUP
213 if (table->adaptive) {
225 if (prev_node == NULL) {
232 while (prev_node->
next != NULL) {
234 prev_node = prev_node->
next;
237 prev_node->
next = node;
252 ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
253 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
254 # ifndef UNIV_HOTBACKUP
255 if (table->adaptive) {
257 ut_a(del_node->block->n_pointers > 0);
258 del_node->block->n_pointers--;
276 #
if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
284 ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
286 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
290 node = ha_search_with_data(table, fold, data);
293 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
294 # ifndef UNIV_HOTBACKUP
295 if (table->adaptive) {
296 ut_a(node->block->n_pointers > 0);
297 node->block->n_pointers--;
298 new_block->n_pointers++;
302 node->block = new_block;
304 node->
data = new_data;
308 #ifndef UNIV_HOTBACKUP
323 ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
326 node = ha_chain_get_first(table, fold);
329 if (
page_align(ha_node_get_data(node)) == page) {
333 ha_delete_hash_node(table, node);
339 node = ha_chain_get_first(table, fold);
341 node = ha_chain_get_next(node);
347 node = ha_chain_get_first(table, fold);
352 node = ha_chain_get_next(node);
357 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
375 ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
376 ut_a(start_index <= end_index);
380 for (i = start_index; i <= end_index; i++) {
390 "InnoDB: Error: hash table node"
391 " fold value %lu does not\n"
392 "InnoDB: match the cell number %lu.\n",
393 (ulong) node->
fold, (ulong) i);
416 ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
420 #define PRINT_USED_CELLS
423 #ifdef PRINT_USED_CELLS
430 #ifdef PRINT_USED_CELLS
442 fprintf(file,
"Hash table size %lu",
445 #ifdef PRINT_USED_CELLS
446 fprintf(file,
", used cells %lu", (ulong) cells);
449 if (table->
heaps == NULL && table->heap != NULL) {
456 if (table->heap->free_block) {
460 fprintf(file,
", node heap has %lu buffer(s)\n",
#define UT_LIST_GET_LEN(BASE)
UNIV_INLINE mem_heap_t * hash_get_heap(hash_table_t *table, ulint fold)
UNIV_INTERN ibool ha_insert_for_fold_func(hash_table_t *table, ulint fold, void *data)
UNIV_INLINE page_t * page_align(const void *ptr) __attribute__((const ))
UNIV_INLINE ulint hash_calc_hash(ulint fold, hash_table_t *table)
UNIV_INTERN void ha_clear(hash_table_t *table)
UNIV_INTERN void ha_search_and_update_if_found_func(hash_table_t *table, ulint fold, void *data, void *new_data)
UNIV_INTERN hash_table_t * hash_create(ulint n)
#define mem_heap_free(heap)
UNIV_INTERN void ha_remove_all_nodes_to_page(hash_table_t *table, ulint fold, const page_t *page)
ibool btr_search_fully_disabled
UNIV_INTERN hash_table_t * ha_create_func(ulint n, ulint n_mutexes)
UNIV_INLINE ulint ut_min(ulint n1, ulint n2)
#define ASSERT_HASH_MUTEX_OWN(table, fold)
UNIV_INTERN void ha_print_info(FILE *file, hash_table_t *table)
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
UNIV_INLINE hash_cell_t * hash_get_nth_cell(hash_table_t *table, ulint n)
#define HASH_DELETE_AND_COMPACT(TYPE, NAME, TABLE, NODE)
#define mem_heap_create_in_btr_search(N)
UNIV_INTERN void ut_print_timestamp(FILE *file)
UNIV_INLINE ulint hash_get_n_cells(hash_table_t *table)