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 77b3959b (MDEV-28457).

page_rec_is_second(), page_rec_is_second_last(): Removed the functions
since it is a deadcode.
parent db85d8b0
......@@ -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));
}
......
......@@ -794,17 +794,6 @@ page_rec_is_first(
const page_t* page) /*!< in: page */
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 */
......@@ -816,17 +805,6 @@ page_rec_is_last(
const page_t* page) /*!< in: page */
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.
......
......@@ -192,22 +192,6 @@ page_rec_is_first(
return(page_rec_get_next_const(page_get_infimum_rec(page)) == rec);
}
/************************************************************//**
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 */
......@@ -223,24 +207,6 @@ page_rec_is_last(
return(page_rec_get_next_const(rec) == page_get_supremum_rec(page));
}
/************************************************************//**
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
......
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