diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-10-17 21:43:26 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-10-17 21:43:26 -0400 |
commit | 419d2374bfbc1eae562121fde31c1aa0e8a164cb (patch) | |
tree | 3c91e43520d82b3a1f3e79fa18bcc1a6f536d83b /src/backend/access/gin/ginget.c | |
parent | 48c7d9f6ff99714495b7d6d2ebc44fbbe992cc8f (diff) | |
download | postgresql-419d2374bfbc1eae562121fde31c1aa0e8a164cb.tar.gz postgresql-419d2374bfbc1eae562121fde31c1aa0e8a164cb.zip |
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.
Diffstat (limited to 'src/backend/access/gin/ginget.c')
-rw-r--r-- | src/backend/access/gin/ginget.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/backend/access/gin/ginget.c b/src/backend/access/gin/ginget.c index cf5710b655d..064ac94129d 100644 --- a/src/backend/access/gin/ginget.c +++ b/src/backend/access/gin/ginget.c @@ -51,7 +51,7 @@ findItemInPage(Page page, ItemPointer item, OffsetNumber *off) */ for (*off = FirstOffsetNumber; *off <= maxoff; (*off)++) { - res = compareItemPointers(item, (ItemPointer) GinDataPageGetItem(page, *off)); + res = ginCompareItemPointers(item, (ItemPointer) GinDataPageGetItem(page, *off)); if (res <= 0) return true; @@ -99,9 +99,9 @@ scanForItems(Relation index, GinScanEntry scanEntry, BlockNumber rootPostingTree Page page; BlockNumber blkno; - gdi = prepareScanPostingTree(index, rootPostingTree, TRUE); + gdi = ginPrepareScanPostingTree(index, rootPostingTree, TRUE); - buffer = scanBeginPostingTree(gdi); + buffer = ginScanBeginPostingTree(gdi); IncrBufferRefCount(buffer); /* prevent unpin in freeGinBtreeStack */ freeGinBtreeStack(gdi->stack); @@ -241,7 +241,8 @@ computePartialMatchList(GinBtreeData *btree, GinBtreeStack *stack, GinScanEntry if (gintuple_get_attrnum(btree->ginstate, itup) != scanEntry->attnum) elog(ERROR, "lost saved point in index"); /* must not happen !!! */ - if (compareEntries(btree->ginstate, scanEntry->attnum, newDatum, savedDatum) == 0) + if (ginCompareEntries(btree->ginstate, scanEntry->attnum, + newDatum, savedDatum) == 0) { /* Found! */ if (btree->ginstate->origTupdesc->attrs[scanEntry->attnum - 1]->attbyval == false) @@ -298,7 +299,7 @@ startScanEntry(Relation index, GinState *ginstate, GinScanEntry entry) * posting list in memory */ - prepareEntryScan(&btreeEntry, index, entry->attnum, entry->entry, ginstate); + ginPrepareEntryScan(&btreeEntry, index, entry->attnum, entry->entry, ginstate); btreeEntry.searchMode = TRUE; stackEntry = ginFindLeafPage(&btreeEntry, NULL); page = BufferGetPage(stackEntry->buffer); @@ -359,9 +360,9 @@ startScanEntry(Relation index, GinState *ginstate, GinScanEntry entry) */ LockBuffer(stackEntry->buffer, GIN_UNLOCK); needUnlock = FALSE; - gdi = prepareScanPostingTree(index, rootPostingTree, TRUE); + gdi = ginPrepareScanPostingTree(index, rootPostingTree, TRUE); - entry->buffer = scanBeginPostingTree(gdi); + entry->buffer = ginScanBeginPostingTree(gdi); /* * We keep buffer pinned because we need to prevent deletion of @@ -504,8 +505,8 @@ entryGetNextItem(Relation index, GinScanEntry entry) LockBuffer(entry->buffer, GIN_UNLOCK); if (!ItemPointerIsValid(&entry->curItem) || - compareItemPointers(&entry->curItem, - entry->list + entry->offset - 1) == 0) + ginCompareItemPointers(&entry->curItem, + entry->list + entry->offset - 1) == 0) { /* * First pages are deleted or empty, or we found exact @@ -699,11 +700,11 @@ keyGetItem(Relation index, GinState *ginstate, MemoryContext tempCtx, entry = key->scanEntry + i; while (entry->isFinished == FALSE && - compareItemPointers(&entry->curItem, &myAdvancePast) <= 0) + ginCompareItemPointers(&entry->curItem, &myAdvancePast) <= 0) entryGetItem(index, entry); if (entry->isFinished == FALSE && - compareItemPointers(&entry->curItem, &key->curItem) < 0) + ginCompareItemPointers(&entry->curItem, &key->curItem) < 0) key->curItem = entry->curItem; } @@ -757,7 +758,7 @@ keyGetItem(Relation index, GinState *ginstate, MemoryContext tempCtx, { entry = key->scanEntry + i; if (entry->isFinished == FALSE && - compareItemPointers(&entry->curItem, &curPageLossy) == 0) + ginCompareItemPointers(&entry->curItem, &curPageLossy) == 0) { if (haveLossyEntry) { @@ -810,7 +811,7 @@ keyGetItem(Relation index, GinState *ginstate, MemoryContext tempCtx, { entry = key->scanEntry + i; if (entry->isFinished == FALSE && - compareItemPointers(&entry->curItem, &key->curItem) == 0) + ginCompareItemPointers(&entry->curItem, &key->curItem) == 0) key->entryRes[i] = TRUE; else key->entryRes[i] = FALSE; @@ -1071,10 +1072,10 @@ collectDatumForItem(IndexScanDesc scan, pendingPosition *pos) datum[StopMiddle - 1] = gin_index_getattr(&so->ginstate, itup); datumExtracted[StopMiddle - 1] = true; } - res = compareEntries(&so->ginstate, - entry->attnum, - entry->entry, - datum[StopMiddle - 1]); + res = ginCompareEntries(&so->ginstate, + entry->attnum, + entry->entry, + datum[StopMiddle - 1]); if (res == 0) { @@ -1282,14 +1283,14 @@ scanGetItem(IndexScanDesc scan, ItemPointer advancePast, GinScanKey key = so->keys + i; while (key->isFinished == FALSE && - compareItemPointers(&key->curItem, &myAdvancePast) <= 0) + ginCompareItemPointers(&key->curItem, &myAdvancePast) <= 0) keyGetItem(scan->indexRelation, &so->ginstate, so->tempCtx, key, &myAdvancePast); if (key->isFinished) return FALSE; /* finished one of keys */ - if (compareItemPointers(&key->curItem, item) < 0) + if (ginCompareItemPointers(&key->curItem, item) < 0) *item = key->curItem; } @@ -1321,7 +1322,7 @@ scanGetItem(IndexScanDesc scan, ItemPointer advancePast, { GinScanKey key = so->keys + i; - if (compareItemPointers(item, &key->curItem) == 0) + if (ginCompareItemPointers(item, &key->curItem) == 0) continue; if (ItemPointerIsLossyPage(&key->curItem) && GinItemPointerGetBlockNumber(&key->curItem) == @@ -1372,7 +1373,7 @@ gingetbitmap(PG_FUNCTION_ARGS) bool recheck; if (GinIsNewKey(scan)) - newScanKey(scan); + ginNewScanKey(scan); if (GinIsVoidRes(scan)) PG_RETURN_INT64(0); |