8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:03:03 +01:00

Fix #8291: NULLs should be skipped during index navigation when there's no lower bound and matched conditions are known to ignore NULLs

This commit is contained in:
Dmitry Yemanov 2024-10-24 12:41:16 +03:00
parent c9aa55344a
commit 7886c9cd93

View File

@ -1211,9 +1211,15 @@ InversionNode* Retrieval::makeIndexScanNode(IndexScratch* indexScratch) const
// This index is never used for IS NULL, thus we can ignore NULLs
// already at index scan. But this rule doesn't apply to nod_equiv
// which requires NULLs to be found in the index.
// A second exception is when this index is used for navigation.
if (ignoreNullsOnScan && !(idx->idx_runtime_flags & idx_navigate))
//
// dimitr: make sure the check below is never moved outside the IF scope,
// as this flag must not be set for a full index scan,
// see also the assertion below
if (ignoreNullsOnScan)
{
fb_assert(indexScratch->lowerCount || indexScratch->upperCount);
retrieval->irb_generic |= irb_ignore_null_value_key;
}
const auto& lastSegment = segments[count - 1];