aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/arrayfuncs.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2023-03-23 15:29:28 -0400
committerRobert Haas <rhaas@postgresql.org>2023-03-24 11:06:45 -0400
commit8fd5aa76c3673348437f4779ba3bd710eadb44f2 (patch)
tree3bc558b002a6b7d5ae54aad5c99940ba804fc7b6 /src/backend/utils/adt/arrayfuncs.c
parent9dac02c772587f1ff645ad5b97e55c5e1c6206ad (diff)
downloadpostgresql-8fd5aa76c3673348437f4779ba3bd710eadb44f2.tar.gz
postgresql-8fd5aa76c3673348437f4779ba3bd710eadb44f2.zip
amcheck: Fix verify_heapam for tuples where xmin or xmax is 0.
In such cases, get_xid_status() doesn't set its output parameter (the third argument), so we shouldn't fall through to code which will test the value of that parameter. There are five existing calls to get_xid_status(), three of which seem to already handle this case properly. This commit tries to fix the other two. If we're checking xmin and find that it is invalid (i.e. 0) just report that as corruption, similar to what's already done in the three cases that seem correct. If we're checking xmax and find that's invalid, that's fine: it just means that the tuple hasn't been updated or deleted. Thanks to Andres Freund and valgrind for finding this problem, and also to Andres for having a look at the patch. This bug seems to go all the way back to where verify_heapam was first introduced, but wasn't detected until recently, possibly because of the new test cases added for update chain verification. Back-patch to v14, where this code showed up. Discussion: http://postgr.es/m/CA+TgmoZAYzQZqyUparXy_ks3OEOfLD9-bEXt8N-2tS1qghX9gQ@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/arrayfuncs.c')
0 files changed, 0 insertions, 0 deletions