Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-10

DataSet.Locate: different behaviour between FPC 2.6.2 and 2.7.1 (rev. 2013/09/01)

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

silvioprog

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?

Thank you!

Silvio Clécio My public projects - github.com/silvioprog
LacaK
to silvioprog

silvioprog wrote / napísal(a):

Show quoted text 24 lines
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
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.

silvioprog
to LacaK

2013/10/24 LacaK

Show quoted text 36 lines
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