Commit 58bea7ac authored by marko's avatar marko

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.
parent 97a03baf
......@@ -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);
......
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