diff options
author | Peter Geoghegan <pg@bowt.ie> | 2020-04-07 15:56:52 -0700 |
---|---|---|
committer | Peter Geoghegan <pg@bowt.ie> | 2020-04-07 15:56:52 -0700 |
commit | 60cbd7751c1ec6ffdf2ffc520ddeb35cb2f2ed70 (patch) | |
tree | 26f89ab0572c1c9f8e6dec25fad8de7f90fc1ec1 /src/backend/access/nbtree/nbtutils.c | |
parent | c6550776394e25c1620bc8258427c8f1d448080d (diff) | |
download | postgresql-60cbd7751c1ec6ffdf2ffc520ddeb35cb2f2ed70.tar.gz postgresql-60cbd7751c1ec6ffdf2ffc520ddeb35cb2f2ed70.zip |
Remove nbtree BTreeTupleSetAltHeapTID() function.
Since heap TID is supposed to be just another key attribute to the
implementation, it doesn't make much sense to have separate
BTreeTupleSetNAtts() and BTreeTupleSetAltHeapTID() functions. Merge the
two functions together. This slightly simplifies _bt_truncate().
Diffstat (limited to 'src/backend/access/nbtree/nbtutils.c')
-rw-r--r-- | src/backend/access/nbtree/nbtutils.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c index 86cec248593..08d7201f196 100644 --- a/src/backend/access/nbtree/nbtutils.c +++ b/src/backend/access/nbtree/nbtutils.c @@ -2239,7 +2239,7 @@ _bt_truncate(Relation rel, IndexTuple lastleft, IndexTuple firstright, */ if (keepnatts <= nkeyatts) { - BTreeTupleSetNAtts(pivot, keepnatts); + BTreeTupleSetNAtts(pivot, keepnatts, false); return pivot; } @@ -2262,11 +2262,13 @@ _bt_truncate(Relation rel, IndexTuple lastleft, IndexTuple firstright, /* Cannot leak memory here */ pfree(pivot); - /* Store heap TID in enlarged pivot tuple */ + /* + * Store all of firstright's key attribute values plus a tiebreaker heap + * TID value in enlarged pivot tuple + */ tidpivot->t_info &= ~INDEX_SIZE_MASK; tidpivot->t_info |= newsize; - BTreeTupleSetNAtts(tidpivot, nkeyatts); - BTreeTupleSetAltHeapTID(tidpivot); + BTreeTupleSetNAtts(tidpivot, nkeyatts, true); pivotheaptid = BTreeTupleGetHeapTID(tidpivot); /* |