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.
This commit is contained in:
Marko Mäkelä 2019-08-16 09:54:33 +03:00
parent 112589cded
commit 555af003e4

View File

@ -4725,7 +4725,7 @@ wait_table_again:
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
rec = NULL; rec = NULL;
goto lock_wait_or_error; goto page_read_error;
} }
pcur->trx_if_known = trx; pcur->trx_if_known = trx;
@ -4779,7 +4779,7 @@ wait_table_again:
index->table->file_unreadable = true; index->table->file_unreadable = true;
} }
rec = NULL; rec = NULL;
goto lock_wait_or_error; goto page_read_error;
} }
} }
@ -4800,7 +4800,7 @@ rec_loop:
if (!index->table->is_readable()) { if (!index->table->is_readable()) {
err = DB_DECRYPTION_FAILED; err = DB_DECRYPTION_FAILED;
goto lock_wait_or_error; goto page_read_error;
} }
ut_ad(!!page_rec_is_comp(rec) == comp); ut_ad(!!page_rec_is_comp(rec) == comp);
@ -4895,7 +4895,7 @@ wrong_offs:
ut_ad(0); ut_ad(0);
err = DB_CORRUPTION; err = DB_CORRUPTION;
goto lock_wait_or_error; goto page_read_error;
} else { } else {
/* The user may be dumping a corrupt table. Jump /* The user may be dumping a corrupt table. Jump
over the corruption to recover as much as possible. */ over the corruption to recover as much as possible. */
@ -5717,6 +5717,10 @@ not_moved:
goto normal_return; goto normal_return;
lock_wait_or_error: 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. */ /* Reset the old and new "did semi-consistent read" flags. */
if (UNIV_UNLIKELY(prebuilt->row_read_type if (UNIV_UNLIKELY(prebuilt->row_read_type
== ROW_READ_DID_SEMI_CONSISTENT)) { == ROW_READ_DID_SEMI_CONSISTENT)) {
@ -5724,11 +5728,6 @@ lock_wait_or_error:
} }
did_semi_consistent_read = FALSE; did_semi_consistent_read = FALSE;
/*-------------------------------------------------------------*/
if (!dict_index_is_spatial(index)) {
btr_pcur_store_position(pcur, &mtr);
}
lock_table_wait: lock_table_wait:
mtr.commit(); mtr.commit();
mtr_has_extra_clust_latch = FALSE; mtr_has_extra_clust_latch = FALSE;