From 36200de4719f294fe2ad547d782754cfbef4cf05 Mon Sep 17 00:00:00 2001 From: Vlad Khorsun Date: Thu, 5 May 2022 12:11:15 +0300 Subject: [PATCH] Attempt to fix recent crashes in oltp-emul test. --- src/jrd/recsrc/IndexTableScan.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jrd/recsrc/IndexTableScan.cpp b/src/jrd/recsrc/IndexTableScan.cpp index 0befcca78d..a266dd5d72 100644 --- a/src/jrd/recsrc/IndexTableScan.cpp +++ b/src/jrd/recsrc/IndexTableScan.cpp @@ -647,6 +647,10 @@ void IndexTableScan::setPage(thread_db* tdbb, Impure* impure, win* window) const } impure->irsb_nav_page = newPage; + + // clear position as page was changed + impure->irsb_nav_incarnation = 0; + impure->irsb_nav_offset = 0; } } @@ -659,8 +663,10 @@ void IndexTableScan::setPosition(thread_db* tdbb, { // We can actually set position without having a data page // fetched; if not, just set the incarnation to the lowest possible - impure->irsb_nav_incarnation = CCH_get_incarnation(window); + // Note, setPage could clear position (incarnation and offset). + setPage(tdbb, impure, window); + impure->irsb_nav_incarnation = CCH_get_incarnation(window); impure->irsb_nav_number = rpb->rpb_number; // save the current key value