Commit 6ecd734f authored by marko's avatar marko

branches/zip: Minor improvements.

page_zip_compress(): Add a debug check that the trx_id and roll_ptr columns
of deleted records are zero-filled.  This should provide some detection
against misdirected writes.

page_zip_decompress(): Correct typos in comments.
parent 6ba1aed1
...@@ -675,6 +675,34 @@ page_zip_compress( ...@@ -675,6 +675,34 @@ page_zip_compress(
ut_ad(!c_stream.avail_in); ut_ad(!c_stream.avail_in);
ut_ad(c_stream.next_in == src); ut_ad(c_stream.next_in == src);
#ifdef UNIV_DEBUG
if (memcmp(src, zero,
DATA_TRX_ID_LEN
+ DATA_ROLL_PTR_LEN)) {
/* Ensure that this is an
allocated user record. */
ulint offs = ut_align_offset(
rec, UNIV_PAGE_SIZE);
byte* slot = buf_end
- PAGE_ZIP_DIR_SLOT_SIZE
* page_get_n_recs((page_t*)
page);
for (; slot < buf_end; slot
+= PAGE_ZIP_DIR_SLOT_SIZE) {
if (offs == (mach_read_from_2(slot)
& PAGE_ZIP_DIR_SLOT_MASK)) {
goto found_record;
}
}
/* All deleted records should be
zero-filled. */
ut_error;
}
found_record:
#endif
memcpy(storage - (DATA_TRX_ID_LEN memcpy(storage - (DATA_TRX_ID_LEN
+ DATA_ROLL_PTR_LEN) + DATA_ROLL_PTR_LEN)
* (rec_get_heap_no_new(rec) - 1), * (rec_get_heap_no_new(rec) - 1),
...@@ -1518,7 +1546,7 @@ page_zip_decompress( ...@@ -1518,7 +1546,7 @@ page_zip_decompress(
/* Check if there are any externally stored columns. /* Check if there are any externally stored columns.
For each externally stored column, restore the For each externally stored column, restore the
BTR_EXTERN_FIELD_REF separately._*/ BTR_EXTERN_FIELD_REF separately. */
for (i = 0; i < rec_offs_n_fields(offsets); i++) { for (i = 0; i < rec_offs_n_fields(offsets); i++) {
ulint len; ulint len;
...@@ -1733,7 +1761,7 @@ err_exit: ...@@ -1733,7 +1761,7 @@ err_exit:
/* Check if there are any externally stored columns. /* Check if there are any externally stored columns.
For each externally stored column, restore the For each externally stored column, restore the
BTR_EXTERN_FIELD_REF separately._*/ BTR_EXTERN_FIELD_REF separately. */
if (slot < page_get_n_recs(page)) { if (slot < page_get_n_recs(page)) {
for (i = 0; i < rec_offs_n_fields(offsets); for (i = 0; i < rec_offs_n_fields(offsets);
......
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