summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-11-07 17:14:07 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-11-08 15:27:29 +0530
commitf4519fb772b2c2c0a6dcb0b93cb147e5dc1627b2 (patch)
treef3906f05a848b5e9c289984216e2be905d026eb8
parentdb85d8b0931f2ca170b2257695fc35acd58d6a57 (diff)
downloadmariadb-git-f4519fb772b2c2c0a6dcb0b93cb147e5dc1627b2.tar.gz
MDEV-28797 Assertion `page_rec_is_user_rec(rec)' failed in PageBulk::getSplitRec
- During alter operation of compressed table, page split operation chooses the first record of the page as split record and it leads to empty left page. This issue caused by the commit 77b3959b5c1528f33ada7aa4445cccf5b5e197b0 (MDEV-28457). page_rec_is_second(), page_rec_is_second_last(): Removed the functions since it is a deadcode.
-rw-r--r--storage/innobase/btr/btr0bulk.cc2
-rw-r--r--storage/innobase/include/page0page.h22
-rw-r--r--storage/innobase/include/page0page.inl34
3 files changed, 1 insertions, 57 deletions
diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
index 3d5a0c2fb00..5fd07ed6d79 100644
--- a/storage/innobase/btr/btr0bulk.cc
+++ b/storage/innobase/btr/btr0bulk.cc
@@ -634,7 +634,7 @@ PageBulk::getSplitRec()
< total_used_size / 2);
/* Keep at least one record on left page */
- if (page_rec_is_second(rec, m_page)) {
+ if (page_rec_is_first(rec, m_page)) {
rec = page_rec_get_next(rec);
ut_ad(page_rec_is_user_rec(rec));
}
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index b0e2eb98d01..0ad42474f84 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -795,17 +795,6 @@ page_rec_is_first(
MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
-true if the record is the second user record on a page.
-@return true if the second user record */
-UNIV_INLINE
-bool
-page_rec_is_second(
-/*===============*/
- const rec_t* rec, /*!< in: record */
- const page_t* page) /*!< in: page */
- MY_ATTRIBUTE((warn_unused_result));
-
-/************************************************************//**
true if the record is the last user record on a page.
@return true if the last user record */
UNIV_INLINE
@@ -817,17 +806,6 @@ page_rec_is_last(
MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
-true if the record is the second last user record on a page.
-@return true if the second last user record */
-UNIV_INLINE
-bool
-page_rec_is_second_last(
-/*====================*/
- const rec_t* rec, /*!< in: record */
- const page_t* page) /*!< in: page */
- MY_ATTRIBUTE((warn_unused_result));
-
-/************************************************************//**
Returns the maximum combined size of records which can be inserted on top
of record heap.
@return maximum combined size for inserted records */
diff --git a/storage/innobase/include/page0page.inl b/storage/innobase/include/page0page.inl
index 61c1b96ff79..6c0167edcf9 100644
--- a/storage/innobase/include/page0page.inl
+++ b/storage/innobase/include/page0page.inl
@@ -193,22 +193,6 @@ page_rec_is_first(
}
/************************************************************//**
-true if the record is the second user record on a page.
-@return true if the second user record */
-UNIV_INLINE
-bool
-page_rec_is_second(
-/*===============*/
- const rec_t* rec, /*!< in: record */
- const page_t* page) /*!< in: page */
-{
- ut_ad(page_get_n_recs(page) > 1);
- if (const rec_t *first= page_rec_get_next_const(page_get_infimum_rec(page)))
- return page_rec_get_next_const(first) == rec;
- return false;
-}
-
-/************************************************************//**
true if the record is the last user record on a page.
@return true if the last user record */
UNIV_INLINE
@@ -224,24 +208,6 @@ page_rec_is_last(
}
/************************************************************//**
-true if the record is the second last user record on a page.
-@return true if the second last user record */
-UNIV_INLINE
-bool
-page_rec_is_second_last(
-/*====================*/
- const rec_t* rec, /*!< in: record */
- const page_t* page) /*!< in: page */
-{
- ut_ad(page_get_n_recs(page) > 1);
- ut_ad(!page_rec_is_last(rec, page));
-
- if (const rec_t *next= page_rec_get_next_const(rec))
- return page_rec_is_supremum(page_rec_get_next_const(next));
- return false;
-}
-
-/************************************************************//**
Returns the middle record of the records on the page. If there is an
even number of records in the list, returns the first record of the
upper half-list.