summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-11-08 11:04:26 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-11-08 11:04:26 +0200
commita6d614fb4ad8df0daa402690b7a0a547a727a04b (patch)
tree7f225e5180cad61fdfcec4966310495a7388460a /storage
parent5b72e8136fd439b9d297bdf50d5d5d2e8a119665 (diff)
downloadmariadb-git-a6d614fb4ad8df0daa402690b7a0a547a727a04b.tar.gz
MDEV-12353 preparation: Remove redundant writes
fsp_alloc_seg_inode_page(): Ever since commit 3926673ce7149aa223103126b6aeac819b10fab5 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.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/btr/btr0cur.cc4
-rw-r--r--storage/innobase/fsp/fsp0fsp.cc22
2 files changed, 10 insertions, 16 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 72232766e4d..a3fb214cd80 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -7870,8 +7870,8 @@ next_zip_page:
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
diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc
index 3b324b6c437..ef379f2ffc3 100644
--- a/storage/innobase/fsp/fsp0fsp.cc
+++ b/storage/innobase/fsp/fsp0fsp.cc
@@ -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);
}