Skip to content

Commit

Permalink
Fixed bug CORE-2165 : Unnecessary 1 index read may occur when using s…
Browse files Browse the repository at this point in the history
…trict inequality condition
  • Loading branch information
hvlad committed Dec 25, 2013
1 parent 7ef7eb3 commit 2e7ca28
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/jrd/btr.cpp
Expand Up @@ -555,8 +555,12 @@ static void checkForLowerKeySkip(bool& skipLowerKey,
else
{
// Check if we have a duplicate node (for the same page)
if (node.prefix < lower.key_length) {
skipLowerKey = false;
if (node.prefix < lower.key_length)
{
if (node.prefix + node.length == lower.key_length)
skipLowerKey = (memcmp(node.data, lower.key_data + node.prefix, node.length) == 0);
else
skipLowerKey = false;
}
else if ((node.prefix == lower.key_length) && node.length)
{
Expand Down

0 comments on commit 2e7ca28

Please sign in to comment.