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;