Commit c5fd0ac4 authored by marko's avatar marko

branches/zip: buf_block_align(): Fix a bogus debug assertion

that was introduced in r4036, to address Issue #161.
parent 14757946
...@@ -1863,12 +1863,52 @@ buf_block_align( ...@@ -1863,12 +1863,52 @@ buf_block_align(
buf_block_init() so that block[n].frame == buf_block_init() so that block[n].frame ==
block->frame + n * UNIV_PAGE_SIZE. Check it. */ block->frame + n * UNIV_PAGE_SIZE. Check it. */
ut_ad(block->frame == page_align(ptr)); ut_ad(block->frame == page_align(ptr));
/* The space id and page number should be #ifdef UNIV_DEBUG
stamped on the page. */ /* A thread that updates these fields must
ut_ad(block->page.space hold buf_pool_mutex and block->mutex. Acquire
== page_get_space_id(page_align(ptr))); only the latter. */
ut_ad(block->page.offset mutex_enter(&block->mutex);
== page_get_page_no(page_align(ptr)));
switch (buf_block_get_state(block)) {
case BUF_BLOCK_ZIP_FREE:
case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_ZIP_DIRTY:
/* These types should only be used in
the compressed buffer pool, whose
memory is allocated from
buf_pool->chunks, in UNIV_PAGE_SIZE
blocks flagged as BUF_BLOCK_MEMORY. */
ut_error;
break;
case BUF_BLOCK_NOT_USED:
case BUF_BLOCK_READY_FOR_USE:
case BUF_BLOCK_MEMORY:
/* Some data structures contain
"guess" pointers to file pages. The
file pages may have been freed and
reused. Do not complain. */
break;
case BUF_BLOCK_REMOVE_HASH:
/* buf_LRU_block_remove_hashed_page()
will overwrite the FIL_PAGE_OFFSET and
FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID with
0xff and set the state to
BUF_BLOCK_REMOVE_HASH. */
ut_ad(page_get_space_id(page_align(ptr))
== 0xffffffff);
ut_ad(page_get_page_no(page_align(ptr))
== 0xffffffff);
break;
case BUF_BLOCK_FILE_PAGE:
ut_ad(block->page.space
== page_get_space_id(page_align(ptr)));
ut_ad(block->page.offset
== page_get_page_no(page_align(ptr)));
break;
}
mutex_exit(&block->mutex);
#endif /* UNIV_DEBUG */
return(block); return(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