diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-11 15:21:58 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-11 15:21:58 +0200 |
commit | 0117d0e65ac8051bc9f6d14764a2ab05e69bd895 (patch) | |
tree | d1e4caed5ef82fa8b46106321da4491ee57420e3 /storage/innobase/include | |
parent | bce71a2909a8add9d0ca848bb387bacfd6e588e9 (diff) | |
parent | 0308de94ee806c21b6776ecab73396da75282596 (diff) | |
download | mariadb-git-0117d0e65ac8051bc9f6d14764a2ab05e69bd895.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/btr0btr.h | 37 | ||||
-rw-r--r-- | storage/innobase/include/btr0btr.ic | 33 | ||||
-rw-r--r-- | storage/innobase/include/fut0lst.h | 8 | ||||
-rw-r--r-- | storage/innobase/include/fut0lst.ic | 4 | ||||
-rw-r--r-- | storage/innobase/include/page0page.h | 11 | ||||
-rw-r--r-- | storage/innobase/include/page0page.ic | 21 |
6 files changed, 26 insertions, 88 deletions
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index efa00fe1ead..c58715560ee 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -293,26 +293,23 @@ btr_page_get_level(const page_t* page) return(level); } MY_ATTRIBUTE((warn_unused_result)) -/********************************************************//** -Gets the next index page number. -@return next page number */ -UNIV_INLINE -ulint -btr_page_get_next( -/*==============*/ - const page_t* page, /*!< in: index page */ - mtr_t* mtr) /*!< in: mini-transaction handle */ - MY_ATTRIBUTE((warn_unused_result)); -/********************************************************//** -Gets the previous index page number. -@return prev page number */ -UNIV_INLINE -ulint -btr_page_get_prev( -/*==============*/ - const page_t* page, /*!< in: index page */ - mtr_t* mtr) /*!< in: mini-transaction handle */ - MY_ATTRIBUTE((warn_unused_result)); + +/** Read FIL_PAGE_NEXT. +@param page buffer pool page +@return previous page number */ +inline uint32_t btr_page_get_next(const page_t* page) +{ + return mach_read_from_4(page + FIL_PAGE_NEXT); +} + +/** Read FIL_PAGE_PREV. +@param page buffer pool page +@return previous page number */ +inline uint32_t btr_page_get_prev(const page_t* page) +{ + return mach_read_from_4(page + FIL_PAGE_PREV); +} + /**************************************************************//** Releases the latch on a leaf page and bufferunfixes it. */ UNIV_INLINE diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic index 93f27e0f4e7..bc990f728e6 100644 --- a/storage/innobase/include/btr0btr.ic +++ b/storage/innobase/include/btr0btr.ic @@ -91,23 +91,6 @@ btr_page_set_level( } /********************************************************//** -Gets the next index page number. -@return next page number */ -UNIV_INLINE -ulint -btr_page_get_next( -/*==============*/ - const page_t* page, /*!< in: index page */ - mtr_t* mtr MY_ATTRIBUTE((unused))) - /*!< in: mini-transaction handle */ -{ - ut_ad(page != NULL); - ut_ad(mtr != NULL); - - return(mach_read_from_4(page + FIL_PAGE_NEXT)); -} - -/********************************************************//** Sets the next index page field. */ UNIV_INLINE void @@ -131,22 +114,6 @@ btr_page_set_next( } /********************************************************//** -Gets the previous index page number. -@return prev page number */ -UNIV_INLINE -ulint -btr_page_get_prev( -/*==============*/ - const page_t* page, /*!< in: index page */ - mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mini-transaction handle */ -{ - ut_ad(page != NULL); - ut_ad(mtr != NULL); - - return(mach_read_from_4(page + FIL_PAGE_PREV)); -} - -/********************************************************//** Sets the previous index page field. */ UNIV_INLINE void diff --git a/storage/innobase/include/fut0lst.h b/storage/innobase/include/fut0lst.h index 3f68660ae89..9fa928eda23 100644 --- a/storage/innobase/include/fut0lst.h +++ b/storage/innobase/include/fut0lst.h @@ -85,8 +85,12 @@ inline void flst_init(buf_block_t* block, uint16_t ofs, mtr_t* mtr) @param[in,out] mtr mini-transaction */ inline void flst_zero_addr(fil_faddr_t* faddr, mtr_t* mtr) { - mlog_memset(faddr + FIL_ADDR_PAGE, 4, 0xff, mtr); - mlog_write_ulint(faddr + FIL_ADDR_BYTE, 0, MLOG_2BYTES, mtr); + if (mach_read_from_4(faddr + FIL_ADDR_PAGE) != FIL_NULL) { + mlog_memset(faddr + FIL_ADDR_PAGE, 4, 0xff, mtr); + } + if (mach_read_from_2(faddr + FIL_ADDR_BYTE)) { + mlog_write_ulint(faddr + FIL_ADDR_BYTE, 0, MLOG_2BYTES, mtr); + } } /********************************************************************//** diff --git a/storage/innobase/include/fut0lst.ic b/storage/innobase/include/fut0lst.ic index 0a4f2b24738..ec4181b2c93 100644 --- a/storage/innobase/include/fut0lst.ic +++ b/storage/innobase/include/fut0lst.ic @@ -82,7 +82,9 @@ flst_init( MTR_MEMO_PAGE_X_FIX | MTR_MEMO_PAGE_SX_FIX)); - mlog_write_ulint(base + FLST_LEN, 0, MLOG_4BYTES, mtr); + if (mach_read_from_4(base + FLST_LEN)) { + mlog_write_ulint(base + FLST_LEN, 0, MLOG_4BYTES, mtr); + } flst_zero_addr(base + FLST_FIRST, mtr); flst_zero_addr(base + FLST_LAST, mtr); } diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index 95fc31d6c49..0d137086569 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -871,17 +871,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 bfe568c23a0..d13f5732faf 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -911,27 +911,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 / |