From 555af003e4291dc41e21fe143ca19649972e2ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 16 Aug 2019 09:54:33 +0300 Subject: [PATCH] MDEV-8588/MDEV-19740: Restore a condition It looks like the merge of MySQL 5.7.9 to MariaDB 10.2.2 conflicted with earlier changes that were made in MDEV-8588. row_search_mvcc(): If the page is corrupted, avoid invoking btr_cur_store_position(). The caller should not try to fetch the next record after a hard error. --- storage/innobase/row/row0sel.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 6b3542e7aa3..19130576425 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -4725,7 +4725,7 @@ wait_table_again: if (err != DB_SUCCESS) { rec = NULL; - goto lock_wait_or_error; + goto page_read_error; } pcur->trx_if_known = trx; @@ -4779,7 +4779,7 @@ wait_table_again: index->table->file_unreadable = true; } rec = NULL; - goto lock_wait_or_error; + goto page_read_error; } } @@ -4800,7 +4800,7 @@ rec_loop: if (!index->table->is_readable()) { err = DB_DECRYPTION_FAILED; - goto lock_wait_or_error; + goto page_read_error; } ut_ad(!!page_rec_is_comp(rec) == comp); @@ -4895,7 +4895,7 @@ wrong_offs: ut_ad(0); err = DB_CORRUPTION; - goto lock_wait_or_error; + goto page_read_error; } else { /* The user may be dumping a corrupt table. Jump over the corruption to recover as much as possible. */ @@ -5717,6 +5717,10 @@ not_moved: goto normal_return; lock_wait_or_error: + if (!dict_index_is_spatial(index)) { + btr_pcur_store_position(pcur, &mtr); + } +page_read_error: /* Reset the old and new "did semi-consistent read" flags. */ if (UNIV_UNLIKELY(prebuilt->row_read_type == ROW_READ_DID_SEMI_CONSISTENT)) { @@ -5724,11 +5728,6 @@ lock_wait_or_error: } did_semi_consistent_read = FALSE; - /*-------------------------------------------------------------*/ - if (!dict_index_is_spatial(index)) { - btr_pcur_store_position(pcur, &mtr); - } - lock_table_wait: mtr.commit(); mtr_has_extra_clust_latch = FALSE;