Commit 11fefe4d authored by marko's avatar marko

branches/zip: Improve some assertions.

recv_parse_or_apply_log_rec_body(): Assert that mlog_parse_nbytes() is
never called on compressed B-tree pages.

page_zip_simple_validate(): Correct a typo in a debug assertion.

xdes_calc_descriptor_page(): Fix an incorrect debug assertion.
parent 4fe0b066
...@@ -620,11 +620,11 @@ xdes_calc_descriptor_page( ...@@ -620,11 +620,11 @@ xdes_calc_descriptor_page(
+ (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
# error # error
#endif #endif
ut_ad(zip_size <= XDES_ARR_OFFSET
+ (zip_size / FSP_EXTENT_SIZE) * XDES_SIZE);
if (!zip_size) { if (!zip_size) {
return(ut_2pow_round(offset, UNIV_PAGE_SIZE)); return(ut_2pow_round(offset, UNIV_PAGE_SIZE));
} else { } else {
ut_ad(zip_size > XDES_ARR_OFFSET
+ (zip_size / FSP_EXTENT_SIZE) * XDES_SIZE);
return(ut_2pow_round(offset, zip_size)); return(ut_2pow_round(offset, zip_size));
} }
} }
......
...@@ -132,7 +132,7 @@ page_zip_simple_validate( ...@@ -132,7 +132,7 @@ page_zip_simple_validate(
{ {
ut_ad(page_zip); ut_ad(page_zip);
ut_ad(page_zip->data); ut_ad(page_zip->data);
ut_ad(ut_is_2pow(zip_size)); ut_ad(ut_is_2pow(page_zip->size));
ut_ad(page_zip->size <= UNIV_PAGE_SIZE); ut_ad(page_zip->size <= UNIV_PAGE_SIZE);
ut_ad(page_zip->size > PAGE_DATA + PAGE_ZIP_DIR_SLOT_SIZE); ut_ad(page_zip->size > PAGE_DATA + PAGE_ZIP_DIR_SLOT_SIZE);
ut_ad(page_zip->m_start <= page_zip->m_end); ut_ad(page_zip->m_start <= page_zip->m_end);
......
...@@ -764,6 +764,7 @@ recv_parse_or_apply_log_rec_body( ...@@ -764,6 +764,7 @@ recv_parse_or_apply_log_rec_body(
switch (type) { switch (type) {
case MLOG_1BYTE: case MLOG_2BYTES: case MLOG_4BYTES: case MLOG_8BYTES: case MLOG_1BYTE: case MLOG_2BYTES: case MLOG_4BYTES: case MLOG_8BYTES:
ut_a(!page_zip || fil_page_get_type(page) != FIL_PAGE_INDEX);
ptr = mlog_parse_nbytes(type, ptr, end_ptr, page); ptr = mlog_parse_nbytes(type, ptr, end_ptr, page);
break; break;
case MLOG_REC_INSERT: case MLOG_COMP_REC_INSERT: case MLOG_REC_INSERT: case MLOG_COMP_REC_INSERT:
......
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