aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2018-10-24 10:45:34 -0400
committerAndrew Dunstan <andrew@dunslane.net>2018-10-24 10:56:27 -0400
commit040a1df6149f852c3b8de96d9d13258af8a39e23 (patch)
tree864706cd0ce76295b6ee8549906cd78da8967ff5 /src/backend
parent5ef037cf0b9e130120c5a788f1f1048f6242b076 (diff)
downloadpostgresql-040a1df6149f852c3b8de96d9d13258af8a39e23.tar.gz
postgresql-040a1df6149f852c3b8de96d9d13258af8a39e23.zip
Correctly set t_self for heap tuples in expand_tuple
Commit 16828d5c0 incorrectly set an invalid pointer for t_self for heap tuples. This patch correctly copies it from the source tuple, and includes a regression test that relies on it being set correctly. Backpatch to release 11. Fixes bug #15448 reported by Tillmann Schulz Diagnosis and test case by Amit Langote
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/access/common/heaptuple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 15444cf5824..28127b311f5 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -856,7 +856,7 @@ expand_tuple(HeapTuple *targetHeapTuple,
= (HeapTupleHeader) ((char *) *targetHeapTuple + HEAPTUPLESIZE);
(*targetHeapTuple)->t_len = len;
(*targetHeapTuple)->t_tableOid = sourceTuple->t_tableOid;
- ItemPointerSetInvalid(&((*targetHeapTuple)->t_self));
+ (*targetHeapTuple)->t_self = sourceTuple->t_self;
targetTHeader->t_infomask = sourceTHeader->t_infomask;
targetTHeader->t_hoff = hoff;