postgresql/contrib/amcheck
Andres Freund a42f515d6b amcheck: Fix ordering bug in update_cached_xid_range()
The initialization order in update_cached_xid_range() was wrong, calling
FullTransactionIdFromXidAndCtx() before setting
->next_xid. FullTransactionIdFromXidAndCtx() uses ->next_xid.

In most situations this will not cause visible issues, because the next call
to update_cached_xid_range() will use a less wrong ->next_xid. It's rare that
xids advance fast enough for this to be a problem.

Found while adding more asserts to the 64bit xid infrastructure.

Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://postgr.es/m/20230108002923.cyoser3ttmt63bfn@awork3.anarazel.de
Backpatch: 14-, where heapam verification was introduced
2023-03-11 14:14:56 -08:00
..
expected Make relation-enumerating operations be security-restricted operations. 2022-05-09 08:35:12 -07:00
sql Make relation-enumerating operations be security-restricted operations. 2022-05-09 08:35:12 -07:00
t Harden TAP tests that intentionally corrupt page checksums. 2022-03-25 14:23:26 -04:00
.gitignore
amcheck--1.0--1.1.sql Add amcheck verification of heap relations belonging to btree indexes. 2018-03-31 19:52:01 -07:00
amcheck--1.0.sql
amcheck--1.1--1.2.sql Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
amcheck--1.2--1.3.sql Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
amcheck.control Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
Makefile Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
verify_heapam.c amcheck: Fix ordering bug in update_cached_xid_range() 2023-03-11 14:14:56 -08:00
verify_nbtree.c Replace RelationOpenSmgr() with RelationGetSmgr(). 2022-11-17 16:54:30 -05:00