Re: Add PQsendSyncMessage() to libpq - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: Add PQsendSyncMessage() to libpq
Date
Msg-id CAGECzQRwkYVzAD3S3u2PYt5E16xZKqL0nUYQXZ05tO=pCAdcKA@mail.gmail.com
Whole thread Raw
In response to Re: Add PQsendSyncMessage() to libpq  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Add PQsendSyncMessage() to libpq
List pgsql-hackers
On Mon, 15 Jan 2024 at 08:50, Michael Paquier <michael@paquier.xyz> wrote:
> Yeah, I'll go with that after a second look.  Attached is what I am
> finishing with, and I have reproduced some numbers with the pgbench
> metacommand mentioned upthread, which is reeeaaally nice.

Code looks good to me. But one small notes on the test.

+     /* second pipeline */
+     if (PQsendQueryParams(conn, "SELECT $1", 1, dummy_param_oids,
+                                     dummy_params, NULL, NULL, 0) != 1)
+           pg_fatal("dispatching first SELECT failed: %s",
PQerrorMessage(conn));

Error message should be "second SELECT" not "first SELECT". Same note
for the error message in the third pipeline, where it still says
"second SELECT".


+     res = PQgetResult(conn);
+     if (res == NULL)
+           pg_fatal("PQgetResult returned null when there's a
pipeline item: %s",
+                        PQerrorMessage(conn));
+
+     if (PQresultStatus(res) != PGRES_TUPLES_OK)
+           pg_fatal("Unexpected result code %s from first pipeline item",
+                        PQresStatus(PQresultStatus(res)));
+     PQclear(res);
+     res = NULL;
+
+     if (PQgetResult(conn) != NULL)
+           pg_fatal("PQgetResult returned something extra after first result");

same issue: s/first/second/g (and s/second/third/g for the existing
part of the test).



pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed
Next
From: Daniel Gustafsson
Date:
Subject: Re: On login trigger: take three