mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 19:41:47 +01:00
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.
This commit is contained in:
parent
97a03baf41
commit
58bea7acaf
1 changed files with 12 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue