From 372102b81dd0096764b712deffab00732f3c9d80 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Wed, 24 Oct 2018 10:45:34 -0400 Subject: 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 --- src/backend/access/common/heaptuple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/access/common/heaptuple.c') diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index efe4ac0e7dc..5f34b26a2ce 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -893,7 +893,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; -- cgit v1.2.3