Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0ab01e8

Browse files
committed
Merge branch 'PGPROEE10_1521' into PGPROEE10
2 parents afd0e93 + cda4e22 commit 0ab01e8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backend/access/nbtree/nbtsort.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,10 +1083,14 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
10831083
* to compare it with the following tuple
10841084
* and maybe unite them into a posting tuple
10851085
*/
1086-
itupprev = itup;
1086+
if (itupprev)
1087+
pfree(itupprev);
1088+
itupprev = CopyIndexTuple(itup);
10871089

10881090
/* compute max size of ipd list */
1089-
maxpostingsize = maxitemsize - IndexInfoFindDataOffset(itupprev->t_info) - MAXALIGN(IndexTupleSize(itupprev));
1091+
maxpostingsize = maxitemsize -
1092+
IndexInfoFindDataOffset(itupprev->t_info) -
1093+
MAXALIGN(IndexTupleSize(itupprev));
10901094
}
10911095

10921096
/* Handle the last item.*/

0 commit comments

Comments
 (0)