Commit a6d614fb authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12353 preparation: Remove redundant writes

fsp_alloc_seg_inode_page(): Ever since
commit 3926673c
all newly allocated pages are zero-initialized.
Assert that this is the case for the FSEG_ID fields.
(Side note: before that fix, other parts of the pages
could contain nonzero garbage.)

btr_store_big_rec_extern_fields(): Remove the redundant initialization
of the most significant 32 bits of BTR_EXTERN_LEN. InnoDB never supported
BLOBs that are longer than 4GiB. In fact, dtuple_convert_big_rec()
would write emit an error message if a clustered index record tuple would
exceed 1,000,000,000 bytes in length.
parent 5b72e813
......@@ -7870,8 +7870,8 @@ btr_store_big_rec_extern_fields(
extern_len -= store_len;
mlog_write_ulint(field_ref + BTR_EXTERN_LEN, 0,
MLOG_4BYTES, &mtr);
ut_ad(!mach_read_from_4(BTR_EXTERN_LEN
+ field_ref));
mlog_write_ulint(field_ref
+ BTR_EXTERN_LEN + 4,
big_rec_vec->fields[i].len
......
......@@ -1539,9 +1539,7 @@ fsp_alloc_seg_inode_page(
fsp_header_t* space_header,
mtr_t* mtr)
{
fseg_inode_t* inode;
buf_block_t* block;
page_t* page;
ut_ad(page_offset(space_header) == FSP_HEADER_OFFSET);
ut_ad(page_get_space_id(page_align(space_header)) == space->id);
......@@ -1556,24 +1554,20 @@ fsp_alloc_seg_inode_page(
buf_block_dbg_add_level(block, SYNC_FSP_PAGE);
ut_ad(rw_lock_get_sx_lock_count(&block->lock) == 1);
page = buf_block_get_frame(block);
mlog_write_ulint(page + FIL_PAGE_TYPE, FIL_PAGE_INODE,
mlog_write_ulint(block->frame + FIL_PAGE_TYPE, FIL_PAGE_INODE,
MLOG_2BYTES, mtr);
const ulint physical_size = space->physical_size();
for (ulint i = 0; i < FSP_SEG_INODES_PER_PAGE(physical_size); i++) {
inode = fsp_seg_inode_page_get_nth_inode(
page, i, physical_size, mtr);
mlog_write_ull(inode + FSEG_ID, 0, mtr);
#ifdef UNIV_DEBUG
const byte* inode = FSEG_ID + FSEG_ARR_OFFSET + block->frame;
for (ulint i = FSP_SEG_INODES_PER_PAGE(space->physical_size()); i--;
inode += FSEG_INODE_SIZE) {
ut_ad(!mach_read_from_8(inode));
}
#endif
flst_add_last(
space_header + FSP_SEG_INODES_FREE,
page + FSEG_INODE_PAGE_NODE, mtr);
block->frame + FSEG_INODE_PAGE_NODE, mtr);
return(true);
}
......
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