public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tatsuo Ishii <[email protected]>
To: [email protected]
Subject: pgpool: Fix empty query case in aborted transaction.
Date: Tue, 19 May 2026 06:16:19 +0000
Message-ID: <[email protected]> (raw)
Fix empty query case in aborted transaction.
Commit eea522ebfcf791a623e865deaa1aa6fb59e3c50b changed user visible
behavior for empty queries (empty string or comment only queries) in
an explicit transaction in abort state. The commit missed the fact
that an empty query can be issued in the aborted state transaction
without any errors. As a result, an empty query raises "current
transaction is aborted, commands ignored until end of transaction
block" error by check_transaction_state_and_abort(), which is
wrong. Before the commit, the error was not raised.
This commit fixes the oversight by adding local flag "is_empty_query"
to SimpleQuery(). If the raw parser finds that a query is empty, the
flag is set to true. Then check_transaction_state_and_abort() is not
called and the empty query is forwarded to backend and processed just
like regular queries.
In passing, checking whether TSTATE in MAIN_NODE_ID is 'E' in
check_transaction_state_and_abort() is removed since it's not
necessary: subsequent code checks the transaction state by calling
pool_is_failed_transaction().
Also add test case to 128.aborted_transaction provided by raivil.
Reported-by: Ronaldo Raivil
Author: Tatsuo Ishii <[email protected]>
Discussion: https://github.com/pgpool/pgpool2/issues/161
Backpatch-through: v4.3
Branch
------
V4_7_STABLE
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=a4aa28c46e4f4c018966cfc401a69ed699420...
Modified Files
--------------
src/protocol/pool_proto_modules.c | 34 +++++++++++-----------
.../tests/128.aborted_transaction/expected.txt | 22 ++++++++++++++
.../tests/128.aborted_transaction/test.sh | 11 +++++++
3 files changed, 50 insertions(+), 17 deletions(-)
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgpool: Fix empty query case in aborted transaction.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox