pgsql: Fix bug in COMMIT AND CHAIN command.

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix bug in COMMIT AND CHAIN command.
Date: 2021-02-19 13:00:05
Message-ID: E1lD5O9-0008PO-1G@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix bug in COMMIT AND CHAIN command.

This commit fixes COMMIT AND CHAIN command so that it starts new transaction
immediately even if savepoints are defined within the transaction to commit.
Previously COMMIT AND CHAIN command did not in that case because
commit 280a408b48 forgot to make CommitTransactionCommand() handle
a transaction chaining when the transaction state was TBLOCK_SUBCOMMIT.

Also this commit adds the regression test for COMMIT AND CHAIN command
when savepoints are defined.

Back-patch to v12 where transaction chaining was added.

Reported-by: Arthur Nascimento
Author: Fujii Masao
Reviewed-by: Arthur Nascimento, Vik Fearing
Discussion: https://postgr.es/m/16867-3475744069228158@postgresql.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fadcc4e81bd99e6032ae042cae53be0c6eea7580

Modified Files
--------------
src/backend/access/transam/xact.c | 7 ++++++
src/test/regress/expected/transactions.out | 40 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql | 11 ++++++++
3 files changed, 58 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2021-02-19 13:00:19 pgsql: Fix bug in COMMIT AND CHAIN command.
Previous Message Peter Eisentraut 2021-02-19 07:15:02 pgsql: Update snowball