Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/interfaces/libpq/fe-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1810,8 +1810,8 @@ PQgetResult(PGconn *conn)
* EOF indication. We expect therefore that this won't result in any
* undue delay in reporting a previous write failure.)
*/
if (flushResult ||
pqWait(true, false, conn) ||
if (flushResult || (zpq_buffered_rx(conn->zstream) == 0 &&
pqWait(true, false, conn)) ||
pqReadData(conn) < 0)
{
/*
Expand Down
6 changes: 3 additions & 3 deletions src/interfaces/libpq/fe-protocol3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ pqGetCopyData3(PGconn *conn, char **buffer, int async)
if (async)
return 0;
/* Need to load more data */
if (pqWait(true, false, conn) ||
if ((zpq_buffered_rx(conn->zstream) == 0 && pqWait(true, false, conn)) ||
pqReadData(conn) < 0)
return -2;
continue;
Expand Down Expand Up @@ -1737,7 +1737,7 @@ pqGetline3(PGconn *conn, char *s, int maxlen)
while ((status = PQgetlineAsync(conn, s, maxlen - 1)) == 0)
{
/* need to load more data */
if (pqWait(true, false, conn) ||
if ((zpq_buffered_rx(conn->zstream) == 0 && pqWait(true, false, conn)) ||
pqReadData(conn) < 0)
{
*s = '\0';
Expand Down Expand Up @@ -1975,7 +1975,7 @@ pqFunctionCall3(PGconn *conn, Oid fnid,
if (needInput)
{
/* Wait for some data to arrive (or for the channel to close) */
if (pqWait(true, false, conn) ||
if ((zpq_buffered_rx(conn->zstream) == 0 && pqWait(true, false, conn)) ||
pqReadData(conn) < 0)
break;
}
Expand Down