BUG #18960: Mistake in test test_simple_pipeline (libpq_pipeline.c)

PG Bug reporting form <noreply@postgresql.org>

From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: d.kovalenko@postgrespro.ru
Date: 2025-06-18T19:25:04Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Make libpq_pipeline.c shorter and more uniform via helper functions.

  2. pg_dump: Allow pg_dump to dump the statistics for foreign tables.

The following bug has been logged on the website:

Bug reference:      18960
Logged by:          Dmitry Kovalenko
Email address:      d.kovalenko@postgrespro.ru
PostgreSQL version: 18beta1
Operating system:   any
Description:        

Hello,
Please look at these test lines in
src/test/modules/libpq_pipeline/libpq_pipeline.c 1657-1662:
https://github.com/postgres/postgres/blob/c2e2589ab969eb802493191c79de844bf7dc3a6e/src/test/modules/libpq_pipeline/libpq_pipeline.c#L1657-L1662
---
        PQclear(res);
        res = NULL;
        if (PQgetResult(conn) != NULL)
                pg_fatal("PQgetResult returned something extra after
pipeline end: %s",
                                 PQresStatus(PQresultStatus(res)));
---
You forgot to assign res:
---
        PQclear(res);
        res = NULL;
        if ((res = PQgetResult(conn)) != NULL)
                pg_fatal("PQgetResult returned something extra after
pipeline end: %s",
                                 PQresStatus(PQresultStatus(res)));
---
Thanks&Regards,
Dmitry Kovalenko
PostgresPro, Russia.