Commit 66088021 authored by marko's avatar marko

branches/zip: Remove page_zip_decompress_low(). Do not call page_validate()

on the ZIP_DUMMY index.  Because it does not contain valid collation
information, the ordering check in page_validate() may fail on pages
containing non-binary data.

Instead, let the callers of page_zip_decompress() invoke page_validate()
when the index information is available.
parent 68a65c14
......@@ -1160,6 +1160,7 @@ page_cur_insert_rec_low(
if (!page_zip_decompress(page_zip_orig, page)) {
ut_error; /* Memory corrupted? */
}
ut_ad(page_validate(page, index));
return(NULL);
}
......
......@@ -620,6 +620,7 @@ page_copy_rec_list_end(
new_page))) {
ut_error;
}
ut_ad(page_validate(new_page, index));
return(NULL);
} else {
/* The page was reorganized:
......@@ -729,7 +730,7 @@ page_copy_rec_list_start(
new_page))) {
ut_error;
}
ut_ad(page_validate(new_page, index));
return(NULL);
} else {
/* The page was reorganized:
......
......@@ -1544,16 +1544,14 @@ page_zip_apply_log(
Decompress a page. This function should tolerate errors on the compressed
page. Instead of letting assertions fail, it will return FALSE if an
inconsistency is detected. */
static
ibool
page_zip_decompress_low(
/*====================*/
page_zip_decompress(
/*================*/
/* out: TRUE on success, FALSE on failure */
page_zip_des_t* page_zip,/* in: data, size;
out: m_start, m_end, n_blobs */
page_t* page, /* out: uncompressed page, may be trashed */
ibool do_validate __attribute__((unused)))
/* in: TRUE=assert page_validate() */
page_t* page) /* out: uncompressed page, may be trashed */
{
z_stream d_stream;
dict_index_t* index = NULL;
......@@ -2015,7 +2013,6 @@ page_zip_decompress_low(
recs_done:
ut_a(page_is_comp(page));
ut_ad(!do_validate || page_validate(page, index));
page_zip_fields_free(index);
mem_heap_free(heap);
......@@ -2023,22 +2020,6 @@ page_zip_decompress_low(
return(TRUE);
}
/**************************************************************************
Decompress a page. This function should tolerate errors on the compressed
page. Instead of letting assertions fail, it will return FALSE if an
inconsistency is detected. */
ibool
page_zip_decompress(
/*================*/
/* out: TRUE on success, FALSE on failure */
page_zip_des_t* page_zip,/* in: data, size;
out: m_start, m_end, n_blobs */
page_t* page) /* out: uncompressed page, may be trashed */
{
return(page_zip_decompress_low(page_zip, page, TRUE));
}
#ifdef UNIV_ZIP_DEBUG
/* Flag: make page_zip_validate() compare page headers only */
ibool page_zip_validate_header_only = FALSE;
......@@ -2080,7 +2061,7 @@ page_zip_validate(
temp_page_buf = ut_malloc(2 * UNIV_PAGE_SIZE);
temp_page = ut_align(temp_page_buf, UNIV_PAGE_SIZE);
valid = page_zip_decompress_low(&temp_page_zip, temp_page, FALSE);
valid = page_zip_decompress(&temp_page_zip, temp_page);
if (!valid) {
fputs("page_zip_validate(): failed to decompress\n", stderr);
goto func_exit;
......
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