Commit e148206a authored by marko's avatar marko

branches/zip: Improve diagnostics.

buf_LRU_get_free_block(): When zip_size changes, initialize all fields
of page_zip.  This avoids an assertion failure in page_create_zip() when
a block with an originally larger zip_size is reallocated.

fsp_get_space_header(): Assert that the stored space id matches.

xdes_get_state(): Assert that the state is valid.
parent 8dd095e7
......@@ -419,6 +419,9 @@ loop:
if (block->page_zip.size != zip_size) {
block->page_zip.size = zip_size;
block->page_zip.n_blobs = 0;
block->page_zip.m_start = 0;
block->page_zip.m_end = 0;
if (block->page_zip.data) {
ut_free(block->page_zip.data);
}
......
......@@ -330,6 +330,7 @@ fsp_get_space_header(
#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(header, SYNC_FSP_PAGE);
#endif /* UNIV_SYNC_DEBUG */
ut_ad(id == mach_read_from_4(FSP_SPACE_ID + header));
return(header);
}
......@@ -571,11 +572,15 @@ xdes_get_state(
xdes_t* descr, /* in: descriptor */
mtr_t* mtr) /* in: mtr handle */
{
ulint state;
ut_ad(descr && mtr);
ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
MTR_MEMO_PAGE_X_FIX));
return(mtr_read_ulint(descr + XDES_STATE, MLOG_4BYTES, mtr));
state = mtr_read_ulint(descr + XDES_STATE, MLOG_4BYTES, mtr);
ut_ad(state - 1 < XDES_FSEG);
return(state);
}
/**************************************************************************
......
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