diff options
Diffstat (limited to 'storage/innobase/btr/btr0cur.cc')
-rw-r--r-- | storage/innobase/btr/btr0cur.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 8c657bc341b..5696d184386 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -775,6 +775,7 @@ btr_cur_optimistic_latch_leaves( { ulint mode; ulint left_page_no; + ulint curr_page_no; switch (*latch_mode) { case BTR_SEARCH_LEAF: @@ -801,16 +802,32 @@ btr_cur_optimistic_latch_leaves( goto unpin_failed; } + + curr_page_no = block->page.id.page_no(); left_page_no = btr_page_get_prev( buf_block_get_frame(block)); rw_lock_s_unlock(&block->lock); if (left_page_no != FIL_NULL) { - cursor->left_block = btr_block_get( + dberr_t err = DB_SUCCESS; + cursor->left_block = buf_page_get_gen( page_id_t(cursor->index->table->space_id, left_page_no), cursor->index->table->space->zip_size(), - mode, cursor->index, mtr); + mode, nullptr, BUF_GET_POSSIBLY_FREED, + __FILE__, __LINE__, mtr, &err); + + if (err == DB_DECRYPTION_FAILED) { + cursor->index->table->file_unreadable = true; + } + + if (btr_page_get_next(cursor->left_block->frame) + != curr_page_no) { + /* release the left block */ + btr_leaf_page_release( + cursor->left_block, mode, mtr); + goto unpin_failed; + } } else { cursor->left_block = NULL; } |