pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Subject: [PATCH v7 3/6] if the queue becomes empty, reset the tail too
Date: Tue, 21 Jun 2022 19:35:26 +0200

---
 src/interfaces/libpq/fe-exec.c | 4 ++++
 1 file changed, 4 insertions(+)

inline patch 1: src/interfaces/libpq/fe-exec.c (+4/-0 lines) download inline-1.patchdiff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 4180683194..ed26bab033 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -2988,6 +2988,10 @@ pqCommandQueueAdvance(PGconn *conn) prevquery = conn->cmd_queue_head; conn->cmd_queue_head = conn->cmd_queue_head->next; + /* If the queue is now empty, reset the tail too */ + if (conn->cmd_queue_head == NULL) + conn->cmd_queue_tail = NULL; + /* and make it recyclable */ prevquery->next = NULL; pqRecycleCmdQueueEntry(conn, prevquery); -- 2.30.2
--c6botfw447u3lelj Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-add-some-tests-maybe-wrong.patch"

Message-ID: <no-message-id-29939@localhost>
Permalink:  ../no-message-id-29939@localhost/
Also on:    postgresql.org/message-id/no-message-id-29939@localhost

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: [PATCH v7 3/6] if the queue becomes empty, reset the tail too
  In-Reply-To: <no-message-id-29939@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox