aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/access/nbtree/nbtutils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c
index 610c7de1e51..aaa0c89c7dd 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -2251,6 +2251,7 @@ _bt_truncate(Relation rel, IndexTuple lastleft, IndexTuple firstright,
tidpivot->t_info |= newsize;
BTreeTupleSetNAtts(tidpivot, nkeyatts);
BTreeTupleSetAltHeapTID(tidpivot);
+ pivotheaptid = BTreeTupleGetHeapTID(tidpivot);
/*
* Lehman & Yao use lastleft as the leaf high key in all cases, but don't
@@ -2259,8 +2260,6 @@ _bt_truncate(Relation rel, IndexTuple lastleft, IndexTuple firstright,
* TID. (This is also the closest value to negative infinity that's
* legally usable.)
*/
- pivotheaptid = (ItemPointer) ((char *) tidpivot + newsize -
- sizeof(ItemPointerData));
ItemPointerCopy(BTreeTupleGetMaxHeapTID(lastleft), pivotheaptid);
/*