postgresql/src
Michael Paquier 237d1f3172 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
2022-01-21 14:54:04 +09:00
..
backend Fix one-off bug causing missing commit timestamps for subtransactions 2022-01-21 14:54:04 +09:00
bin Extend the options of pg_basebackup to control compression 2022-01-21 11:08:43 +09:00
common Improve code clarity in epilogue of UTF-8 verification fast path 2022-01-17 22:53:50 -05:00
fe_utils Avoid calling gettext() in signal handlers. 2022-01-17 13:30:04 -05:00
include Support base backup targets. 2022-01-20 10:46:33 -05:00
interfaces Make PQcancel use the PGconn's tcp_user_timeout and keepalives settings. 2022-01-18 14:13:13 -05:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Update copyright for 2022 2022-01-07 19:04:57 -05:00
port Clean up messy API for src/port/thread.c. 2022-01-11 13:46:20 -05:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Add new simple TAP test for tablespaces, attempt II. 2022-01-21 15:38:05 +13:00
timezone Update copyright for 2022 2022-01-07 19:04:57 -05:00
tools Allow clean.bat to be run from anywhere 2022-01-20 10:13:18 -05:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Add support for LZ4 compression in pg_receivewal 2021-11-05 11:33:25 +09:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:27:59 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00