Page 1 of 1

8.4.1: RecordCount is 1 if PageSize not correct

Posted: Wed 10 Mar 2021 14:05
by bursch
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.

Re: 8.4.1: RecordCount is 1 if PageSize not correct

Posted: Mon 05 Apr 2021 16:36
by oleg0k
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