1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Change ginMergeItemPointers to return a palloc'd array.

That seems nicer than making it the caller's responsibility to pass a
suitable-sized array. All the callers were just palloc'ing an array anyway.
This commit is contained in:
Heikki Linnakangas
2014-03-24 18:40:26 +02:00
parent cf5d38f4b9
commit bb42e21be2
4 changed files with 30 additions and 32 deletions

View File

@ -67,12 +67,9 @@ addItemPointersToLeafTuple(GinState *ginstate,
/* merge the old and new posting lists */
oldItems = ginReadTuple(ginstate, attnum, old, &oldNPosting);
newNPosting = oldNPosting + nitem;
newItems = (ItemPointerData *) palloc(sizeof(ItemPointerData) * newNPosting);
newNPosting = ginMergeItemPointers(newItems,
items, nitem,
oldItems, oldNPosting);
newItems = ginMergeItemPointers(items, nitem,
oldItems, oldNPosting,
&newNPosting);
/* Compress the posting list, and try to a build tuple with room for it */
res = NULL;