Skip to content

Commit

Permalink
MDEV-26131 fixup
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Aug 18, 2021
1 parent 0edf44c commit da6f4d5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions storage/innobase/row/row0import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,7 @@ dberr_t FetchIndexRootPages::operator()(buf_block_t* block) UNIV_NOTHROW

const page_t* page = get_frame(block);

index_id_t id = btr_page_get_index_id(page);

m_index.m_id = id;
m_index.m_id = btr_page_get_index_id(page);
m_index.m_page_no = block->page.id.page_no();

/* Check that the tablespace flags match the table flags. */
Expand Down Expand Up @@ -1900,11 +1898,14 @@ PageConverter::update_index_page(

if (is_free(block->page.id.page_no())) {
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);

if (UNIV_UNLIKELY(!index)) {
if (m_cfg->m_missing) {
return DB_SUCCESS;
}

ib::error() << "Page for tablespace " << m_space
<< " is index page with id " << id
<< " but that index is not found from"
Expand Down

0 comments on commit da6f4d5

Please sign in to comment.