8.4.1: RecordCount is 1 if PageSize not correct

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bursch
Posts: 20
Joined: Tue 25 Sep 2018 07:45

8.4.1: RecordCount is 1 if PageSize not correct

Post by bursch » Wed 10 Mar 2021 14:05

Hi,

there is a timing problem in unit PgSQLProtocolUni.

Code: Select all

function TPgSQLReadStream.HasData: boolean;
(....)
        if FCurrentPosition < PageSize then
          Result := True
        else
          Result := False;  // in this case the record count will be set to 1 and stays 1 for ever

Code: Select all

procedure TPgSQLRecordSet.FetchBlock(Block: PBlockHeader; FetchBack: boolean; out RowsObtained: Integer);
(...)
      Command.FReadStream.UseUnicode := Protocol.Net.UseUnicode;
      if Command.FReadStream.HasData or not Command.FReadStream.IsLastRow then
        RowsObtained := Command.FReadStream.FetchStmt(FFetchRows, Block, ReceiveFetchBuffer)
      else
        RowsObtained := 0;
 (...)
 end;
Since it is a timing problem, a test project is difficult to create. The problem does not occur on every computer.

oleg0k
Devart Team
Posts: 190
Joined: Wed 11 Mar 2020 08:28

Re: 8.4.1: RecordCount is 1 if PageSize not correct

Post by oleg0k » Mon 05 Apr 2021 16:36

Hello,
The new version of PgDAC containing the fix is already available for download.
Please let us know if you need any further assistance.

wbr, Oleg
Devart Team

Post Reply