postgresql/src/backend/access
Fujii Masao 0e0174b497 Fix incorrect WAL description for PREPARE TRANSACTION record.
Since commit 8b1dccd37c, the PREPARE TRANSACTION WAL record includes
information about dropped statistics entries. However, the WAL resource
manager description function for PREPARE TRANSACTION record failed to
parse this information correctly and always assumed there were
no such entries.

As a result, for example, pg_waldump could not display the dropped
statistics entries stored in PREPARE TRANSACTION records.

The root cause was that ParsePrepareRecord() did not set the number of
statistics entries to drop on commit or abort. These values remained
zero-initialized and were never updated from the parsed record.

This commit fixes the issue by properly setting those values during parsing.
With this fix, pg_waldump can now correctly report dropped statistics
entries in PREPARE TRANSACTION records.

Back-patch to v15, where commit 8b1dccd37c was introduced.

Author: Daniil Davydov <3danissimo@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAJDiXgh-6Epb2XiJe4uL0zF-cf0_s_7Lw1TfEHDMLzYjEmfGOw@mail.gmail.com
Backpatch-through: 15
2025-05-21 11:56:39 +09:00
..
brin Keep the decompressed filter in brin_bloom_union 2025-03-26 17:03:02 +01:00
common doc: 1-byte varlena headers can be used for user PLAIN storage 2023-10-31 09:10:35 -04:00
gin Fix GIN's shimTriConsistentFn to not corrupt its input. 2025-04-12 12:27:46 -04:00
gist Relax assertion in finding correct GiST parent 2025-04-04 13:50:00 +03:00
hash Allow _h_indexbuild() to be interrupted. 2024-09-13 16:16:47 -04:00
heap At update of non-LP_NORMAL TID, fail instead of corrupting page header. 2025-01-25 11:28:19 -08:00
index Unpin buffer before inplace update waits for an XID to end. 2024-10-29 09:39:59 -07:00
nbtree Fix btmarkpos/btrestrpos array key wraparound bug. 2023-09-28 16:29:32 -07:00
rmgrdesc Fix incorrect WAL description for PREPARE TRANSACTION record. 2025-05-21 11:56:39 +09:00
spgist Fix insertion of SP-GiST REDIRECT tuples during REINDEX CONCURRENTLY. 2024-06-17 14:30:59 -04:00
table Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
tablesample Update copyright for 2022 2022-01-07 19:04:57 -05:00
transam Fix FATAL message for invalid recovery timeline at beginning of recovery 2025-02-20 10:43:40 +09:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00