Re: Add PQsendSyncMessage() to libpq

Поиск
Список
Период
Сортировка
От Jelte Fennema-Nio
Тема Re: Add PQsendSyncMessage() to libpq
Дата
Msg-id CAGECzQRwkYVzAD3S3u2PYt5E16xZKqL0nUYQXZ05tO=pCAdcKA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add PQsendSyncMessage() to libpq  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Add PQsendSyncMessage() to libpq  (Michael Paquier <michael@paquier.xyz>)
Список 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 по дате отправления:

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: On login trigger: take three