summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-08-18 16:45:09 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-08-18 16:45:09 +0300
commitda6f4d5164aae2642b1763577e1997d0098cc947 (patch)
tree2efb3c2329ce8576a36040b450da4b2ec49268dd
parent0edf44c53a6b63e0f026b30034fd5f1f36a09556 (diff)
downloadmariadb-git-da6f4d5164aae2642b1763577e1997d0098cc947.tar.gz
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.
-rw-r--r--storage/innobase/row/row0import.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 699392d2a5b..f4df44b3e2b 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -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. */
@@ -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"