diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-06-08 14:53:24 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-06-08 14:53:24 +0300 |
commit | 77b3959b5c1528f33ada7aa4445cccf5b5e197b0 (patch) | |
tree | b69c132a2bda0aba7bd96edaf107ab87a21d1c2b /storage/innobase/include/btr0pcur.inl | |
parent | 892c426371b4be558d32fdeba7d1d56f46b40f2b (diff) | |
download | mariadb-git-77b3959b5c1528f33ada7aa4445cccf5b5e197b0.tar.gz |
MDEV-28457 Crash in page_dir_find_owner_slot()
A prominent remaining source of crashes on corrupted index pages
is page directory corruption.
A frequent caller of page_dir_find_owner_slot() is page_rec_get_prev().
Some of those calls can be replaced with simpler logic that is less
prone to fail.
page_dir_find_owner_slot(),
page_rec_get_prev(), page_rec_get_prev_const(),
btr_pcur_move_to_prev(), btr_pcur_move_to_prev_on_page(),
btr_cur_upd_rec_sys(),
page_delete_rec_list_end(),
rtr_page_copy_rec_list_end_no_locks(),
rtr_page_copy_rec_list_start_no_locks(): Return an error code on failure.
fil_space_t::io(), buf_page_get_low(): Use DB_CORRUPTION for
out-of-bounds page reads.
PageBulk::getSplitRec(), PageBulk::copyOut(): Simplify the code.
btr_validate_level(): Prevent some more CHECK TABLE crashes on
corrupted pages.
btr_block_get(), btr_pcur_move_to_next_page(): Implement some checks that
were previously only part of IndexPurge::next().
IndexPurge::next(): Use btr_pcur_move_to_next_page().
Diffstat (limited to 'storage/innobase/include/btr0pcur.inl')
-rw-r--r-- | storage/innobase/include/btr0pcur.inl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/storage/innobase/include/btr0pcur.inl b/storage/innobase/include/btr0pcur.inl index fd4eeb9392a..b21de209760 100644 --- a/storage/innobase/include/btr0pcur.inl +++ b/storage/innobase/include/btr0pcur.inl @@ -171,17 +171,16 @@ btr_pcur_move_to_next_on_page( /*********************************************************//** Moves the persistent cursor to the previous record on the same page. */ UNIV_INLINE -void +rec_t* btr_pcur_move_to_prev_on_page( /*==========================*/ btr_pcur_t* cursor) /*!< in/out: persistent cursor */ { ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(cursor->latch_mode != BTR_NO_LATCHES); - - page_cur_move_to_prev(btr_pcur_get_page_cur(cursor)); - cursor->old_stored = false; + + return page_cur_move_to_prev(btr_pcur_get_page_cur(cursor)); } /*********************************************************//** |