[Patch] change the return value of PQsendFlushRequest

From: "zhangjie2(at)fujitsu(dot)com" <zhangjie2(at)fujitsu(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [Patch] change the return value of PQsendFlushRequest
Date: 2021-07-05 01:34:58
Message-ID: TYWPR01MB76781872C2B69EC9CDB2FB04F91C9@TYWPR01MB7678.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all

The return value of function PQsendFlushRequest is 1 or 0.
-------------------------------------------------------------------
<para>
Sends a request for the server to flush its output buffer.
<synopsis>
int PQsendFlushRequest(PGconn *conn);
</synopsis>
</para>

<para>
Returns 1 for success. Returns 0 on any failure.
</para>
---------------------------------------------------------------------
But in the following code, false is returned.
I think it would be better to change to 0.

int PQsendFlushRequest(PGconn *conn)
{
......
if (conn->asyncStatus != PGASYNC_IDLE &&
conn->pipelineStatus == PQ_PIPELINE_OFF)
{
appendPQExpBufferStr(&conn->errorMessage,
libpq_gettext("another command is already in progress\n"));
return false; ※
}
......
}

Best Regards!
Zhangjie

Attachment Content-Type Size
PQsendFlushRequest.patch application/octet-stream 428 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-07-05 02:03:12 Re: Can a child process detect postmaster death when in pg_usleep?
Previous Message Michael Paquier 2021-07-05 01:31:54 Re: Disable WAL logging to speed up data loading