]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix bug in COMMIT AND CHAIN command.
authorFujii Masao <fujii@postgresql.org>
Fri, 19 Feb 2021 12:57:52 +0000 (21:57 +0900)
committerFujii Masao <fujii@postgresql.org>
Fri, 19 Feb 2021 12:58:43 +0000 (21:58 +0900)
commit422012c98f8d929f9aa2b2e706b29512f61544e1
tree68c08441965bcb4ea7847da3e25a69f55b836cd9
parentbf9d3a5f847e91154b7cde255da7f24cd129ff35
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
src/backend/access/transam/xact.c
src/test/regress/expected/transactions.out
src/test/regress/sql/transactions.sql