]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix one-off bug causing missing commit timestamps for subtransactions
authorMichael Paquier <michael@paquier.xyz>
Fri, 21 Jan 2022 05:55:04 +0000 (14:55 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 21 Jan 2022 05:55:04 +0000 (14:55 +0900)
commit919be95c6f8aeb954e328e0a0fc0fc48d78a7a46
tree1365d4cde21efc9d607c93e0d6c408dee6cab32e
parent1145ad1ac5b7347071adb6186d9b56421b7ab40f
Fix one-off bug causing missing commit timestamps for subtransactions

The logic in charge of writing commit timestamps (enabled with
track_commit_timestamp) for subtransactions had a one-bug bug,
where it would be possible that commit timestamps go missing for the
last subtransaction committed.

While on it, simplify a bit the iteration logic in the loop writing the
commit timestamps, as per suggestions from Kyotaro Horiguchi and Tom
Lane, so as some variable initializations are not part of the loop
itself.

Issue introduced in 73c986a.

Analyzed-by: Alex Kingsborough
Author: Alex Kingsborough, Kyotaro Horiguchi
Discussion: https://postgr.es/m/73A66172-4050-4F2A-B7F1-13508EDA2144@amazon.com
Backpatch-through: 10
src/backend/access/transam/commit_ts.c