From 58bea7acafc393b86ed7f5206dff36e42dcecda8 Mon Sep 17 00:00:00 2001 From: marko Date: Fri, 9 Nov 2007 15:32:37 +0000 Subject: [PATCH] branches/zip: Undo r2079 and fix the cause of uninitialized data bytes in page_zip_decompress(). page_zip_decompress_clust(), page_zip_decompress_clust_ext(): Zero-fill the columns DB_TRX_ID and DB_ROLL_PTR on the uncompressed page. --- page/page0zip.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/page/page0zip.c b/page/page0zip.c index b921016a84a..739bbb53e2d 100644 --- a/page/page0zip.c +++ b/page/page0zip.c @@ -2165,6 +2165,11 @@ page_zip_decompress_clust_ext( ut_ad(d_stream->next_out == dst); + /* Clear DB_TRX_ID and DB_ROLL_PTR in order to + avoid uninitialized bytes in case the record + is affected by page_zip_apply_log(). */ + memset(dst, 0, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN); + d_stream->next_out += DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN; } else if (rec_offs_nth_extern(offsets, i)) { @@ -2329,6 +2334,11 @@ page_zip_decompress_clust( ut_ad(d_stream->next_out == dst); + /* Clear DB_TRX_ID and DB_ROLL_PTR in order to + avoid uninitialized bytes in case the record + is affected by page_zip_apply_log(). */ + memset(dst, 0, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN); + d_stream->next_out += DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN; } @@ -2505,15 +2515,9 @@ page_zip_decompress( recs = mem_heap_alloc(heap, n_dense * (2 * sizeof *recs)); #ifdef UNIV_ZIP_DEBUG - /* Clear the page. The fill byte used to be 0x55, but we use - 0 from now on in order to mask a known discrepancy: When a - record is freed (i.e., delete-marked and deleted), a shorter - record is allocated from the space, and the page is - compressed, the unused bytes after the shorter record will not - be initialized by the decompressor. */ - memset(page, 0, UNIV_PAGE_SIZE); + /* Clear the page. */ + memset(page, 0x55, UNIV_PAGE_SIZE); #endif /* UNIV_ZIP_DEBUG */ - /* To avoid bogus warnings, use UNIV_MEM_VALID instead. See above. */ UNIV_MEM_INVALID(page, UNIV_PAGE_SIZE); /* Copy the page header. */ memcpy(page, page_zip->data, PAGE_DATA);