@@ -3676,16 +3676,22 @@ void page_zip_write_rec(buf_block_t *block, const byte *rec,
3676
3676
3677
3677
slot = page_zip_dir_find (page_zip, page_offset (rec));
3678
3678
ut_a (slot);
3679
+ byte s = *slot;
3679
3680
/* Copy the delete mark. */
3680
3681
if (rec_get_deleted_flag (rec, TRUE )) {
3681
3682
/* In delete-marked records, DB_TRX_ID must
3682
3683
always refer to an existing undo log record.
3683
3684
On non-leaf pages, the delete-mark flag is garbage. */
3684
3685
ut_ad (!index->is_primary () || !page_is_leaf (page)
3685
3686
|| row_get_rec_trx_id (rec, index, offsets));
3686
- *slot |= PAGE_ZIP_DIR_SLOT_DEL >> 8 ;
3687
+ s |= PAGE_ZIP_DIR_SLOT_DEL >> 8 ;
3687
3688
} 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 );
3689
3695
}
3690
3696
3691
3697
ut_ad (rec_get_start ((rec_t *) rec, offsets) >= page + PAGE_ZIP_START);
@@ -4249,8 +4255,13 @@ page_zip_dir_insert(
4249
4255
}
4250
4256
4251
4257
/* 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);
4254
4265
mtr->zmemcpy (*cursor->block , slot_rec - page_zip->data
4255
4266
- PAGE_ZIP_DIR_SLOT_SIZE, PAGE_ZIP_DIR_SLOT_SIZE);
4256
4267
}
0 commit comments