[fpc-pascal] DataSet.Locate: different behaviour between FPC 2.6.2 and 2.7.1 (rev. 2013/09/01)

silvioprog silvioprog at gmail.com
Fri Oct 25 15:27:52 CEST 2013


2013/10/24 LacaK <lacak at zoznam.sk>

> silvioprog  wrote / napísal(a):
>
>  Hello,
>>
>> This morning, I compiled a code using FPC (Windows, rev. 2013/09/01),
>> after that, my tests using dataset.locate has stopped.
>>
>> The Locate method locates record, even when it does not exists. The
>> problem occurs only with varchar fields, in integer fields it works fine.
>>
>> In attachment I'm sending a small project to reproduce it. Here in my
>> machine I made two tests, please see the log below:
>>
>> Result in FPC 2.6.2:
>>
>> test.exe
>> output: N
>> output: N
>>
>> Result in FPC 2.7.1:
>>
>> test.exe
>> output: N
>> output: Y
>>
>> Can you test it in FPC from trunk?
>>
> I guess, that root of this problem is same like in bug report:
> http://bugs.freepascal.org/**view.php?id=25016<http://bugs.freepascal.org/view.php?id=25016>
> For sorting/locating are used these string comparasion function:
>  AnsiCompareText resp. AnsiCompareStr
> Can you test directly  these functions in any simple string comparation
> test ?
> I expect, that these functions will return wrong results ?
> (may be that string encoding enters into play also? ...  )
> -Laco.


In this tests:

  if AnsiCompareStr('a', 'a') = 0 then
    WriteLn('Yes')
  else
    WriteLn('No');

  if AnsiCompareText('a', 'a') = 0 then
    WriteLn('Yes')
  else
    WriteLn('No');

Both returns "Yes".

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20131025/cdeb3ca5/attachment.html>


More information about the fpc-pascal mailing list