Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
dyemanov committed Feb 25, 2025
1 parent 14530b4 commit 9a0cf7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
19 changes: 7 additions & 12 deletions src/jrd/btr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1241,8 +1241,8 @@ void BTR_evaluate(thread_db* tdbb, const IndexRetrieval* retrieval, RecordBitmap
{
// If we're walking in a descending index and we need to ignore NULLs
// then stop at the first NULL we see (only for single segment!)
if (descending && ignoreNulls && node.prefix == 0 &&
node.length >= 1 && node.data[0] == 255)
if (descending && ignoreNulls &&
node.prefix == 0 && node.length >= 1 && node.data[0] == 255)
{
break;
}
Expand Down Expand Up @@ -6906,18 +6906,13 @@ static bool scan(thread_db* tdbb, UCHAR* pointer, RecordBitmap** bitmap, RecordB
return true;
}

// Ignore NULL-values, this is currently only available for single segment indexes.
// Ignore NULL-values, this is currently only available for single segment indexes
if (ignoreNulls)
{
ignore = false;
if (descending)
{
if ((node.prefix == 0) && (node.length >= 1) && (node.data[0] == 255))
return false;
}
else {
ignore = (node.prefix + node.length == 0); // Ascending (prefix + length == 0)
}
if (descending && node.prefix == 0 && node.length >= 1 && node.data[0] == 255)
return false;

ignore = descending ? false : (node.prefix + node.length == 0);
}

if (skipLowerKey)
Expand Down
4 changes: 2 additions & 2 deletions src/jrd/recsrc/IndexTableScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ bool IndexTableScan::internalGetRecord(thread_db* tdbb) const

// If we're walking in a descending index and we need to ignore NULLs
// then stop at the first NULL we see (only for single segment!)
if (descending && ignoreNulls && node.prefix == 0 &&
node.length >= 1 && node.data[0] == 255)
if (descending && ignoreNulls &&
node.prefix == 0 && node.length >= 1 && node.data[0] == 255)
{
break;
}
Expand Down

0 comments on commit 9a0cf7b

Please sign in to comment.