Skip to content

Commit

Permalink
Backported fix for CORE-3523 - SIMILAR TO: False matches on descendin…
Browse files Browse the repository at this point in the history
…g ranges.
  • Loading branch information
asfernandes committed Jun 17, 2011
1 parent 87ba139 commit c25b2d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
5 changes: 5 additions & 0 deletions doc/WhatsNew
Expand Up @@ -2,6 +2,11 @@
* v2.5.1
**************************

* Bugfix CORE-3523
SIMILAR TO: False matches on descending ranges.
Contributor(s):
Adriano dos Santos Fernandes <adrianosf at uol.com.br>

* Bugfix CORE-3512
Server hangs when trace is running
Contributor(s):
Expand Down
19 changes: 4 additions & 15 deletions src/jrd/SimilarToMatcher.h
Expand Up @@ -850,22 +850,11 @@ void SimilarToMatcher<StrConverter, CharType>::Evaluator::parsePrimary(int* flag
len = charSet->substring(originalPatternLen, originalPatternStr,
sizeof(c), c, patternPos - patternStart, 1);

if (textType->compare(rangeBuffer[previousRangeBufferCount],
&rangeBuffer[previousRangeBufferCount + 1], len, c) <= 0)
{
rangeBuffer.push(len);
rangeCount = rangeBuffer.getCount();
memcpy(rangeBuffer.getBuffer(rangeCount + len) + rangeCount, &c, len);

charsBuffer.push(*patternPos);
}
else
{
rangeBuffer.shrink(previousRangeBufferCount);
charsBuffer.pop();
}
rangeBuffer.push(len);
rangeCount = rangeBuffer.getCount();
memcpy(rangeBuffer.getBuffer(rangeCount + len) + rangeCount, &c, len);

++patternPos;
charsBuffer.push(*patternPos++);
}
}

Expand Down

0 comments on commit c25b2d8

Please sign in to comment.