From 419d2374bfbc1eae562121fde31c1aa0e8a164cb Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 17 Oct 2010 21:43:26 -0400 Subject: 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. --- src/backend/access/gin/gininsert.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/backend/access/gin/gininsert.c') diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c index 263e447ca4..fa70e4fa55 100644 --- a/src/backend/access/gin/gininsert.c +++ b/src/backend/access/gin/gininsert.c @@ -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 */ -- cgit v1.2.1