Commit da6f4d51 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-26131 fixup

PageConverter::update_index_page(): Always validate the PAGE_INDEX_ID.
Failure to do so could cause a crash when iterating
secondary index pages. This was caught by the 10.4 test
innodb.full_crc32_import.
parent 0edf44c5
...@@ -696,9 +696,7 @@ dberr_t FetchIndexRootPages::operator()(buf_block_t* block) UNIV_NOTHROW ...@@ -696,9 +696,7 @@ dberr_t FetchIndexRootPages::operator()(buf_block_t* block) UNIV_NOTHROW
const page_t* page = get_frame(block); const page_t* page = get_frame(block);
index_id_t id = btr_page_get_index_id(page); m_index.m_id = btr_page_get_index_id(page);
m_index.m_id = id;
m_index.m_page_no = block->page.id.page_no(); m_index.m_page_no = block->page.id.page_no();
/* Check that the tablespace flags match the table flags. */ /* Check that the tablespace flags match the table flags. */
...@@ -1900,11 +1898,14 @@ PageConverter::update_index_page( ...@@ -1900,11 +1898,14 @@ PageConverter::update_index_page(
if (is_free(block->page.id.page_no())) { if (is_free(block->page.id.page_no())) {
return(DB_SUCCESS); return(DB_SUCCESS);
} else if ((id = btr_page_get_index_id(page)) != m_index->m_id && !m_cfg->m_missing) { } else if ((id = btr_page_get_index_id(page)) != m_index->m_id) {
row_index_t* index = find_index(id); row_index_t* index = find_index(id);
if (UNIV_UNLIKELY(!index)) { if (UNIV_UNLIKELY(!index)) {
if (m_cfg->m_missing) {
return DB_SUCCESS;
}
ib::error() << "Page for tablespace " << m_space ib::error() << "Page for tablespace " << m_space
<< " is index page with id " << id << " is index page with id " << id
<< " but that index is not found from" << " but that index is not found from"
......
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