mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Fix a passel of inappropriately-named global functions in GIN.
The GIN code has absolutely no business exporting GIN-specific functions with names as generic as compareItemPointers() or newScanKey(); that's just trouble waiting to happen. I got annoyed about this again just now and decided to fix it. This commit ensures that all global symbols defined in access/gin/ have names including "gin" or "Gin". There were a couple of cases, like names involving "PostingItem", where arguably the names were already sufficiently nongeneric; but I figured as long as I was risking creating merge problems for unapplied GIN patches I might as well impose a uniform policy. I didn't touch any static symbol names. There might be some places where it'd be appropriate to rename some static functions to match siblings that are exported, but I'll leave that for another time.
This commit is contained in:
@ -114,9 +114,10 @@ addItemPointersToTuple(Relation index, GinState *ginstate,
|
||||
/* good, small enough */
|
||||
uint32 newnitem;
|
||||
|
||||
newnitem = MergeItemPointers(GinGetPosting(res),
|
||||
GinGetPosting(old), GinGetNPosting(old),
|
||||
items, nitem);
|
||||
newnitem = ginMergeItemPointers(GinGetPosting(res),
|
||||
GinGetPosting(old),
|
||||
GinGetNPosting(old),
|
||||
items, nitem);
|
||||
/* merge might have eliminated some duplicate items */
|
||||
GinShortenTuple(res, newnitem);
|
||||
}
|
||||
@ -130,7 +131,7 @@ addItemPointersToTuple(Relation index, GinState *ginstate,
|
||||
postingRoot = createPostingTree(index, GinGetPosting(old), GinGetNPosting(old));
|
||||
GinSetPostingTree(res, postingRoot);
|
||||
|
||||
gdi = prepareScanPostingTree(index, postingRoot, FALSE);
|
||||
gdi = ginPrepareScanPostingTree(index, postingRoot, FALSE);
|
||||
gdi->btree.isBuild = (buildStats != NULL);
|
||||
|
||||
ginInsertItemPointer(gdi, items, nitem, buildStats);
|
||||
@ -166,7 +167,7 @@ ginEntryInsert(Relation index, GinState *ginstate,
|
||||
if (buildStats)
|
||||
buildStats->nEntries++;
|
||||
|
||||
prepareEntryScan(&btree, index, attnum, value, ginstate);
|
||||
ginPrepareEntryScan(&btree, index, attnum, value, ginstate);
|
||||
|
||||
stack = ginFindLeafPage(&btree, NULL);
|
||||
page = BufferGetPage(stack->buffer);
|
||||
@ -187,7 +188,7 @@ ginEntryInsert(Relation index, GinState *ginstate,
|
||||
freeGinBtreeStack(stack);
|
||||
|
||||
/* insert into posting tree */
|
||||
gdi = prepareScanPostingTree(index, rootPostingTree, FALSE);
|
||||
gdi = ginPrepareScanPostingTree(index, rootPostingTree, FALSE);
|
||||
gdi->btree.isBuild = (buildStats != NULL);
|
||||
ginInsertItemPointer(gdi, items, nitem, buildStats);
|
||||
pfree(gdi);
|
||||
@ -233,7 +234,7 @@ ginHeapTupleBulkInsert(GinBuildState *buildstate, OffsetNumber attnum, Datum val
|
||||
MemoryContext oldCtx;
|
||||
|
||||
oldCtx = MemoryContextSwitchTo(buildstate->funcCtx);
|
||||
entries = extractEntriesSU(buildstate->accum.ginstate, attnum, value, &nentries);
|
||||
entries = ginExtractEntriesSU(buildstate->accum.ginstate, attnum, value, &nentries);
|
||||
MemoryContextSwitchTo(oldCtx);
|
||||
|
||||
if (nentries == 0)
|
||||
@ -420,7 +421,7 @@ ginHeapTupleInsert(Relation index, GinState *ginstate, OffsetNumber attnum, Datu
|
||||
int32 i,
|
||||
nentries;
|
||||
|
||||
entries = extractEntriesSU(ginstate, attnum, value, &nentries);
|
||||
entries = ginExtractEntriesSU(ginstate, attnum, value, &nentries);
|
||||
|
||||
if (nentries == 0)
|
||||
/* nothing to insert */
|
||||
|
Reference in New Issue
Block a user