Commit a2c56cdf authored by marko's avatar marko

branches/zip: btr_search_validate(): Fix an assertion failure that was

introduced in r4036.
Do not call buf_block_get_space(), buf_block_get_page_no()
unless the block state is BUF_BLOCK_FILE_PAGE.

This bug was reported by Michael.
parent 9b3a0836
...@@ -1703,10 +1703,22 @@ btr_search_validate(void) ...@@ -1703,10 +1703,22 @@ btr_search_validate(void)
for (; node != NULL; node = node->next) { for (; node != NULL; node = node->next) {
const buf_block_t* block const buf_block_t* block
= buf_block_align(node->data); = buf_block_align(node->data);
const buf_block_t* hash_block const buf_block_t* hash_block;
= buf_block_hash_get(
if (UNIV_LIKELY(buf_block_get_state(block)
== BUF_BLOCK_FILE_PAGE)) {
/* The space and offset are only valid
for file blocks. It is possible that
the block is being freed
(BUF_BLOCK_REMOVE_HASH, see the
assertion and the comment below) */
hash_block = buf_block_hash_get(
buf_block_get_space(block), buf_block_get_space(block),
buf_block_get_page_no(block)); buf_block_get_page_no(block));
} else {
hash_block = NULL;
}
if (hash_block) { if (hash_block) {
ut_a(hash_block == block); ut_a(hash_block == block);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment