mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
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.
This commit is contained in:
parent
a7e3a7f7c9
commit
0a0e2ff560
1 changed files with 30 additions and 2 deletions
|
@ -675,6 +675,34 @@ page_zip_compress(
|
|||
ut_ad(!c_stream.avail_in);
|
||||
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
|
||||
+ DATA_ROLL_PTR_LEN)
|
||||
* (rec_get_heap_no_new(rec) - 1),
|
||||
|
@ -1518,7 +1546,7 @@ page_zip_decompress(
|
|||
|
||||
/* Check if there are any externally stored columns.
|
||||
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++) {
|
||||
ulint len;
|
||||
|
@ -1733,7 +1761,7 @@ err_exit:
|
|||
|
||||
/* Check if there are any externally stored columns.
|
||||
For each externally stored column, restore the
|
||||
BTR_EXTERN_FIELD_REF separately._*/
|
||||
BTR_EXTERN_FIELD_REF separately. */
|
||||
|
||||
if (slot < page_get_n_recs(page)) {
|
||||
for (i = 0; i < rec_offs_n_fields(offsets);
|
||||
|
|
Loading…
Reference in a new issue