pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A

Поиск
Список
Период
Сортировка
Искать

pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Fix some edge cases with characteristics after COMMIT/ROLLBACK AND CHAIN

Certain combinations of transaction sequences with AND CHAIN failed to
preserve the top-transaction characteristics, in some cases:
* When a transaction block failed, the chained transaction used the
default characteristics, not the characteristics of the transaction
chaining from.
* When COMMIT AND CHAIN was issued in a subtransaction that had the idea
to switch read_only, the chained transaction inherited the read-only
state of the subtransaction, not of the top transaction.  The state is
reset when the subtransaction ends, like RELEASE.  The characteristics
are now saved once all the subtransactions are committed.

Narek has reported the first problem.  I have discovered the second
pattern while digging through this area of the code.  Tests are added
for all the patterns spotted.

Author: Narek Galstyan 
Author: Michael Paquier 
Discussion: https://postgr.es/m/CAHsn6_z-ewqXWe2h--SK93AdnPSOvjvF9KLodWckFZKAjxcONw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3ec393a9b8ac9cedff74339d1cff936d20c79381

Modified Files
--------------
src/backend/access/transam/xact.c          | 18 +++++++
src/test/regress/expected/transactions.out | 76 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql      | 34 +++++++++++++
3 files changed, 128 insertions(+)

FAQ