Spurious set in heap_prune_chain()

Started by Jim Nasbyabout 11 years ago1 messages
#1Jim Nasby
Jim.Nasby@BlueTreble.com
1 attachment(s)

In heap_prune_chain():

tup.t_tableOid = RelationGetRelid(relation);

rootlp = PageGetItemId(dp, rootoffnum);

/*
* If it's a heap-only tuple, then it is not the start of a HOT chain.
*/
if (ItemIdIsNormal(rootlp))
{
htup = (HeapTupleHeader) PageGetItem(dp, rootlp);

tup.t_data = htup;
tup.t_len = ItemIdGetLength(rootlp);
tup.t_tableOid = RelationGetRelid(relation);

AFAICT the second case of setting tup.t_tableOid is pointless. Attached patch removes it. Passes make check.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

Attachments:

patchtext/plain; charset=UTF-8; name=patch; x-mac-creator=0; x-mac-type=0Download
diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c
index 06b5488..4c40f7e 100644
--- a/src/backend/access/heap/pruneheap.c
+++ b/src/backend/access/heap/pruneheap.c
@@ -371,7 +371,6 @@ heap_prune_chain(Relation relation, Buffer buffer, OffsetNumber rootoffnum,
 
 		tup.t_data = htup;
 		tup.t_len = ItemIdGetLength(rootlp);
-		tup.t_tableOid = RelationGetRelid(relation);
 		ItemPointerSet(&(tup.t_self), BufferGetBlockNumber(buffer), rootoffnum);
 
 		if (HeapTupleHeaderIsHeapOnly(htup))