From d1b3d492c0fbcb1efaa9558e658a036c5d93a3c6 Mon Sep 17 00:00:00 2001 From: marko <> Date: Mon, 1 Oct 2007 07:45:02 +0000 Subject: [PATCH] branches/zip: btr_search_validate(): Use buf_block_hash_get(). --- btr/btr0sea.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/btr/btr0sea.c b/btr/btr0sea.c index 809b50843c5..6b512f87eb9 100644 --- a/btr/btr0sea.c +++ b/btr/btr0sea.c @@ -1633,7 +1633,6 @@ btr_search_validate(void) /*=====================*/ /* out: TRUE if ok */ { - buf_block_t* block; page_t* page; ha_node_t* node; ulint n_page_dumps = 0; @@ -1669,18 +1668,17 @@ btr_search_validate(void) node = hash_get_nth_cell(btr_search_sys->hash_index, i)->node; for (; node != NULL; node = node->next) { + const buf_block_t* block; + page = page_align(node->data); { ulint page_no = page_get_page_no(page); ulint space_id= page_get_space_id(page); - block = (buf_block_t*) - buf_page_hash_get(space_id, page_no); + block = buf_block_hash_get(space_id, page_no); } - if (UNIV_UNLIKELY(!block) - || UNIV_UNLIKELY(buf_block_get_state(block) - != BUF_BLOCK_FILE_PAGE)) { + if (UNIV_UNLIKELY(!block)) { /* The block is most probably being freed. The function buf_LRU_search_and_free_block() @@ -1694,7 +1692,7 @@ btr_search_validate(void) continue; } - offsets = rec_get_offsets((rec_t*) node->data, + offsets = rec_get_offsets((const rec_t*) node->data, block->index, offsets, block->curr_n_fields + (block->curr_n_bytes > 0),