Commit 555af003 authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 112589cd
......@@ -4725,7 +4725,7 @@ row_search_mvcc(
if (err != DB_SUCCESS) {
rec = NULL;
goto lock_wait_or_error;
goto page_read_error;
}
pcur->trx_if_known = trx;
......@@ -4779,7 +4779,7 @@ row_search_mvcc(
index->table->file_unreadable = true;
}
rec = NULL;
goto lock_wait_or_error;
goto page_read_error;
}
}
......@@ -4800,7 +4800,7 @@ row_search_mvcc(
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 @@ row_search_mvcc(
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 @@ row_search_mvcc(
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 @@ row_search_mvcc(
}
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment