|
1 | 1 | /***************************************************************************** |
2 | 2 |
|
3 | 3 | Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. |
4 | | -Copyright (c) 2015, 2020, MariaDB Corporation. |
| 4 | +Copyright (c) 2015, 2021, MariaDB Corporation. |
5 | 5 |
|
6 | 6 | This program is free software; you can redistribute it and/or modify it under |
7 | 7 | the terms of the GNU General Public License as published by the Free Software |
@@ -1880,38 +1880,33 @@ dberr_t |
1880 | 1880 | PageConverter::update_index_page( |
1881 | 1881 | buf_block_t* block) UNIV_NOTHROW |
1882 | 1882 | { |
1883 | | -index_id_tid; |
1884 | | -buf_frame_t* page = block->frame; |
1885 | 1883 | const page_id_t page_id(block->page.id()); |
1886 | 1884 |
|
1887 | 1885 | if (is_free(page_id.page_no())) { |
1888 | 1886 | return(DB_SUCCESS); |
1889 | | -} else if ((id = btr_page_get_index_id(page)) != m_index->m_id) { |
| 1887 | +} |
| 1888 | + |
| 1889 | +buf_frame_t* page = block->frame; |
| 1890 | +const index_id_t id = btr_page_get_index_id(page); |
1890 | 1891 |
|
1891 | | -row_index_t* index = find_index(id); |
| 1892 | +if (id != m_index->m_id) { |
| 1893 | +row_index_t* index = find_index(id); |
1892 | 1894 |
|
1893 | 1895 | if (UNIV_UNLIKELY(!index)) { |
1894 | | -ib::error() << "Page for tablespace " << m_space |
1895 | | -<< " is index page with id " << id |
1896 | | -<< " but that index is not found from" |
1897 | | -<< " configuration file. Current index name " |
1898 | | -<< m_index->m_name << " and id " << m_index->m_id; |
1899 | | -m_index = 0; |
1900 | | -return(DB_CORRUPTION); |
| 1896 | +ib::warn() << "Unknown index id " << id |
| 1897 | + << " on page " << page_id.page_no(); |
| 1898 | +return DB_SUCCESS; |
1901 | 1899 | } |
1902 | 1900 |
|
1903 | | -/* Update current index */ |
1904 | 1901 | m_index = index; |
1905 | 1902 | } |
1906 | 1903 |
|
1907 | 1904 | /* If the .cfg file is missing and there is an index mismatch |
1908 | 1905 | then ignore the error. */ |
1909 | | -if (m_cfg->m_missing && (m_index == 0 || m_index->m_srv_index == 0)) { |
| 1906 | +if (m_cfg->m_missing && !m_index->m_srv_index) { |
1910 | 1907 | return(DB_SUCCESS); |
1911 | 1908 | } |
1912 | 1909 |
|
1913 | | - |
1914 | | - |
1915 | 1910 | if (m_index && page_id.page_no() == m_index->m_page_no) { |
1916 | 1911 | byte *b = FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF + FSEG_HDR_SPACE |
1917 | 1912 | + page; |
|
0 commit comments