mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	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
			
			
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user