From 304d19bb6ff06f9f7e2039a7d19b167271c4a36e Mon Sep 17 00:00:00 2001 From: Dmitry Yemanov Date: Mon, 11 Mar 2024 09:08:05 +0300 Subject: [PATCH] Fixed assertion during optimization of mixed list/equality comparisons --- src/jrd/optimizer/Retrieval.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jrd/optimizer/Retrieval.cpp b/src/jrd/optimizer/Retrieval.cpp index 132c67168c..1bdcf53ebd 100644 --- a/src/jrd/optimizer/Retrieval.cpp +++ b/src/jrd/optimizer/Retrieval.cpp @@ -885,13 +885,14 @@ void Retrieval::getInversionCandidates(InversionCandidateList& inversions, } } - if (const auto list = segment.valueList) + if (segment.scanType == segmentScanList) { - fb_assert(segment.scanType == segmentScanList); - if (listCount) // we cannot have more than one list matched to an index break; + const auto list = segment.valueList; + fb_assert(list); + listCount = list->getCount(); maxSelectivity = scratch.selectivity; }