summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/btr/btr0btr.cc26
-rw-r--r--storage/innobase/dict/dict0crea.cc13
-rw-r--r--storage/innobase/include/page0page.h11
-rw-r--r--storage/innobase/include/page0page.ic21
-rw-r--r--storage/innobase/row/row0trunc.cc12
5 files changed, 26 insertions, 57 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index a9b84bdb8da..bb0b5c82f06 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -321,26 +321,24 @@ btr_root_fseg_adjust_on_import(
fseg_header_t* seg_header, /*!< in/out: segment header */
page_zip_des_t* page_zip, /*!< in/out: compressed page,
or NULL */
- ulint space, /*!< in: tablespace identifier */
- mtr_t* mtr) /*!< in/out: mini-transaction */
+ ulint space) /*!< in: tablespace identifier */
{
ulint offset = mach_read_from_2(seg_header + FSEG_HDR_OFFSET);
if (offset < FIL_PAGE_DATA
- || offset > UNIV_PAGE_SIZE - FIL_PAGE_DATA_END) {
+ || offset > srv_page_size - FIL_PAGE_DATA_END) {
+ return false;
+ }
- return(FALSE);
+ seg_header += FSEG_HDR_SPACE;
- } else if (page_zip) {
- mach_write_to_4(seg_header + FSEG_HDR_SPACE, space);
- page_zip_write_header(page_zip, seg_header + FSEG_HDR_SPACE,
- 4, mtr);
- } else {
- mlog_write_ulint(seg_header + FSEG_HDR_SPACE,
- space, MLOG_4BYTES, mtr);
+ mach_write_to_4(seg_header, space);
+ if (UNIV_LIKELY_NULL(page_zip)) {
+ memcpy(page_zip->data + page_offset(seg_header), seg_header,
+ 4);
}
- return(TRUE);
+ return true;
}
/**************************************************************//**
@@ -400,10 +398,10 @@ btr_root_adjust_on_import(
if (err == DB_SUCCESS
&& (!btr_root_fseg_adjust_on_import(
FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
- + page, page_zip, space_id, &mtr)
+ + page, page_zip, space_id)
|| !btr_root_fseg_adjust_on_import(
FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
- + page, page_zip, space_id, &mtr))) {
+ + page, page_zip, space_id))) {
err = DB_CORRUPTION;
}
diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc
index 00268f54677..74c57fdac6f 100644
--- a/storage/innobase/dict/dict0crea.cc
+++ b/storage/innobase/dict/dict0crea.cc
@@ -894,11 +894,14 @@ dict_create_index_tree_step(
err = DB_OUT_OF_FILE_SPACE; );
}
- page_rec_write_field(
- btr_pcur_get_rec(&pcur), DICT_FLD__SYS_INDEXES__PAGE_NO,
- node->page_no, &mtr);
-
- btr_pcur_close(&pcur);
+ ulint len;
+ byte* data = rec_get_nth_field_old(btr_pcur_get_rec(&pcur),
+ DICT_FLD__SYS_INDEXES__PAGE_NO,
+ &len);
+ ut_ad(len == 4);
+ if (mach_read_from_4(data) != node->page_no) {
+ mlog_write_ulint(data, node->page_no, MLOG_4BYTES, &mtr);
+ }
mtr_commit(&mtr);
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index c50e72a6542..2e3bae2d7ff 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -832,17 +832,6 @@ page_rec_find_owner_rec(
/*====================*/
rec_t* rec); /*!< in: the physical record */
-/***********************************************************************//**
-Write a 32-bit field in a data dictionary record. */
-UNIV_INLINE
-void
-page_rec_write_field(
-/*=================*/
- rec_t* rec, /*!< in/out: record to update */
- ulint i, /*!< in: index of the field to update */
- ulint val, /*!< in: value to write */
- mtr_t* mtr) /*!< in/out: mini-transaction */
- MY_ATTRIBUTE((nonnull));
/************************************************************//**
Returns the maximum combined size of records which can be inserted on top
of record heap.
diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic
index 3956ecce0ee..6c12c43b237 100644
--- a/storage/innobase/include/page0page.ic
+++ b/storage/innobase/include/page0page.ic
@@ -919,27 +919,6 @@ page_get_free_space_of_empty(
- 2 * PAGE_DIR_SLOT_SIZE));
}
-/***********************************************************************//**
-Write a 32-bit field in a data dictionary record. */
-UNIV_INLINE
-void
-page_rec_write_field(
-/*=================*/
- rec_t* rec, /*!< in/out: record to update */
- ulint i, /*!< in: index of the field to update */
- ulint val, /*!< in: value to write */
- mtr_t* mtr) /*!< in/out: mini-transaction */
-{
- byte* data;
- ulint len;
-
- data = rec_get_nth_field_old(rec, i, &len);
-
- ut_ad(len == 4);
-
- mlog_write_ulint(data, val, MLOG_4BYTES, mtr);
-}
-
/************************************************************//**
Each user record on a page, and also the deleted user records in the heap
takes its size plus the fraction of the dir cell size /
diff --git a/storage/innobase/row/row0trunc.cc b/storage/innobase/row/row0trunc.cc
index 09573610e7c..648a83f7dc6 100644
--- a/storage/innobase/row/row0trunc.cc
+++ b/storage/innobase/row/row0trunc.cc
@@ -1034,12 +1034,12 @@ CreateIndex::operator()(mtr_t* mtr, btr_pcur_t* pcur) const
root_page_no = FIL_NULL;);
if (root_page_no != FIL_NULL) {
-
- rec_t* rec = btr_pcur_get_rec(pcur);
-
- page_rec_write_field(
- rec, DICT_FLD__SYS_INDEXES__PAGE_NO,
- root_page_no, mtr);
+ ulint len;
+ byte* data = rec_get_nth_field_old(
+ btr_pcur_get_rec(pcur),
+ DICT_FLD__SYS_INDEXES__PAGE_NO, &len);
+ ut_ad(len == 4);
+ mlog_write_ulint(data, root_page_no, MLOG_4BYTES, mtr);
/* We will need to commit and restart the
mini-transaction in order to avoid deadlocks.