Skip to content

Commit 6841d1a

Browse files
committed
Merge 10.5 into 10.6
2 parents 89ab253 + ebb15f9 commit 6841d1a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

storage/innobase/page/page0zip.cc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,16 +3676,22 @@ void page_zip_write_rec(buf_block_t *block, const byte *rec,
36763676

36773677
slot = page_zip_dir_find(page_zip, page_offset(rec));
36783678
ut_a(slot);
3679+
byte s = *slot;
36793680
/* Copy the delete mark. */
36803681
if (rec_get_deleted_flag(rec, TRUE)) {
36813682
/* In delete-marked records, DB_TRX_ID must
36823683
always refer to an existing undo log record.
36833684
On non-leaf pages, the delete-mark flag is garbage. */
36843685
ut_ad(!index->is_primary() || !page_is_leaf(page)
36853686
|| row_get_rec_trx_id(rec, index, offsets));
3686-
*slot |= PAGE_ZIP_DIR_SLOT_DEL >> 8;
3687+
s |= PAGE_ZIP_DIR_SLOT_DEL >> 8;
36873688
} else {
3688-
*slot &= byte(~(PAGE_ZIP_DIR_SLOT_DEL >> 8));
3689+
s &= byte(~(PAGE_ZIP_DIR_SLOT_DEL >> 8));
3690+
}
3691+
3692+
if (s != *slot) {
3693+
*slot = s;
3694+
mtr->zmemcpy(*block, slot - page_zip->data, 1);
36893695
}
36903696

36913697
ut_ad(rec_get_start((rec_t*) rec, offsets) >= page + PAGE_ZIP_START);
@@ -4249,8 +4255,13 @@ page_zip_dir_insert(
42494255
}
42504256

42514257
/* Write the entry for the inserted record.
4252-
The "owned" and "deleted" flags must be zero. */
4253-
mach_write_to_2(slot_rec - PAGE_ZIP_DIR_SLOT_SIZE, page_offset(rec));
4258+
The "owned" flag must be zero. */
4259+
uint16_t offs = page_offset(rec);
4260+
if (rec_get_deleted_flag(rec, true)) {
4261+
offs |= PAGE_ZIP_DIR_SLOT_DEL;
4262+
}
4263+
4264+
mach_write_to_2(slot_rec - PAGE_ZIP_DIR_SLOT_SIZE, offs);
42544265
mtr->zmemcpy(*cursor->block, slot_rec - page_zip->data
42554266
- PAGE_ZIP_DIR_SLOT_SIZE, PAGE_ZIP_DIR_SLOT_SIZE);
42564267
}

0 commit comments

Comments
 (0)