Commit 3b03315f authored by marko's avatar marko

branches/zip: Fix bugs #ifdef UNIV_DEBUG.

rec_convert_dtuple_to_rec_old(): Initialize the record in order to avoid
bogus Valgrind warnings about the ut_ad() in mach_write_to_1() and
mach_write_to_2().

page_zip_compress(), page_zip_write_rec(), page_zip_write_blob_ptr():
Replace ut_ad(page_validate(...)) with ut_ad(page_simple_validate_new(...)),
because otherwise crash recovery would fail.
parent a169d0ec
...@@ -638,7 +638,7 @@ page_zip_compress( ...@@ -638,7 +638,7 @@ page_zip_compress(
ut_a(page_is_comp((page_t*) page)); ut_a(page_is_comp((page_t*) page));
ut_a(fil_page_get_type((page_t*) page) == FIL_PAGE_INDEX); ut_a(fil_page_get_type((page_t*) page) == FIL_PAGE_INDEX);
ut_ad(page_validate((page_t*) page, index)); ut_ad(page_simple_validate_new((page_t*) page));
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
/* Check the data that will be omitted. */ /* Check the data that will be omitted. */
...@@ -2146,7 +2146,7 @@ page_zip_write_rec( ...@@ -2146,7 +2146,7 @@ page_zip_write_rec(
page = page_align((rec_t*) rec); page = page_align((rec_t*) rec);
ut_ad(page_zip_header_cmp(page_zip, page)); ut_ad(page_zip_header_cmp(page_zip, page));
ut_ad(page_validate(page, index)); ut_ad(page_simple_validate_new(page));
slot = page_zip_dir_find(page_zip, page_offset(rec)); slot = page_zip_dir_find(page_zip, page_offset(rec));
ut_a(slot); ut_a(slot);
...@@ -2441,7 +2441,7 @@ page_zip_write_blob_ptr( ...@@ -2441,7 +2441,7 @@ page_zip_write_blob_ptr(
ulint len; ulint len;
ut_ad(buf_block_get_page_zip(buf_block_align((byte*)rec)) == page_zip); ut_ad(buf_block_get_page_zip(buf_block_align((byte*)rec)) == page_zip);
ut_ad(page_validate(page, index)); ut_ad(page_simple_validate_new(page));
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
ut_ad(page_zip->size > PAGE_DATA + page_zip_dir_size(page_zip)); ut_ad(page_zip->size > PAGE_DATA + page_zip_dir_size(page_zip));
ut_ad(rec_offs_comp(offsets)); ut_ad(rec_offs_comp(offsets));
......
...@@ -933,7 +933,11 @@ rec_convert_dtuple_to_rec_old( ...@@ -933,7 +933,11 @@ rec_convert_dtuple_to_rec_old(
/* Calculate the offset of the origin in the physical record */ /* Calculate the offset of the origin in the physical record */
rec = buf + rec_get_converted_extra_size(data_size, n_fields); rec = buf + rec_get_converted_extra_size(data_size, n_fields);
#ifdef UNIV_DEBUG
/* Suppress Valgrind warnings of ut_ad()
in mach_write_to_1(), mach_write_to_2() et al. */
memset(buf, 0xff, rec - buf + data_size);
#endif /* UNIV_DEBUG */
/* Store the number of fields */ /* Store the number of fields */
rec_set_n_fields_old(rec, n_fields); rec_set_n_fields_old(rec, n_fields);
......
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