mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +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:
@ -172,10 +172,10 @@ entryIsMoveRight(GinBtree btree, Page page)
|
||||
|
||||
itup = getRightMostTuple(page);
|
||||
|
||||
if (compareAttEntries(btree->ginstate,
|
||||
btree->entryAttnum, btree->entryValue,
|
||||
gintuple_get_attrnum(btree->ginstate, itup),
|
||||
gin_index_getattr(btree->ginstate, itup)) > 0)
|
||||
if (ginCompareAttEntries(btree->ginstate,
|
||||
btree->entryAttnum, btree->entryValue,
|
||||
gintuple_get_attrnum(btree->ginstate, itup),
|
||||
gin_index_getattr(btree->ginstate, itup)) > 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
@ -221,8 +221,9 @@ entryLocateEntry(GinBtree btree, GinBtreeStack *stack)
|
||||
else
|
||||
{
|
||||
itup = (IndexTuple) PageGetItem(page, PageGetItemId(page, mid));
|
||||
result = compareAttEntries(btree->ginstate,
|
||||
btree->entryAttnum, btree->entryValue,
|
||||
result = ginCompareAttEntries(btree->ginstate,
|
||||
btree->entryAttnum,
|
||||
btree->entryValue,
|
||||
gintuple_get_attrnum(btree->ginstate, itup),
|
||||
gin_index_getattr(btree->ginstate, itup));
|
||||
}
|
||||
@ -286,8 +287,9 @@ entryLocateLeafEntry(GinBtree btree, GinBtreeStack *stack)
|
||||
int result;
|
||||
|
||||
itup = (IndexTuple) PageGetItem(page, PageGetItemId(page, mid));
|
||||
result = compareAttEntries(btree->ginstate,
|
||||
btree->entryAttnum, btree->entryValue,
|
||||
result = ginCompareAttEntries(btree->ginstate,
|
||||
btree->entryAttnum,
|
||||
btree->entryValue,
|
||||
gintuple_get_attrnum(btree->ginstate, itup),
|
||||
gin_index_getattr(btree->ginstate, itup));
|
||||
if (result == 0)
|
||||
@ -636,7 +638,7 @@ ginPageGetLinkItup(Buffer buf)
|
||||
* Also called from ginxlog, should not use btree
|
||||
*/
|
||||
void
|
||||
entryFillRoot(GinBtree btree, Buffer root, Buffer lbuf, Buffer rbuf)
|
||||
ginEntryFillRoot(GinBtree btree, Buffer root, Buffer lbuf, Buffer rbuf)
|
||||
{
|
||||
Page page;
|
||||
IndexTuple itup;
|
||||
@ -655,7 +657,7 @@ entryFillRoot(GinBtree btree, Buffer root, Buffer lbuf, Buffer rbuf)
|
||||
}
|
||||
|
||||
void
|
||||
prepareEntryScan(GinBtree btree, Relation index, OffsetNumber attnum, Datum value, GinState *ginstate)
|
||||
ginPrepareEntryScan(GinBtree btree, Relation index, OffsetNumber attnum, Datum value, GinState *ginstate)
|
||||
{
|
||||
memset(btree, 0, sizeof(GinBtreeData));
|
||||
|
||||
@ -670,7 +672,7 @@ prepareEntryScan(GinBtree btree, Relation index, OffsetNumber attnum, Datum valu
|
||||
btree->isEnoughSpace = entryIsEnoughSpace;
|
||||
btree->placeToPage = entryPlaceToPage;
|
||||
btree->splitPage = entrySplitPage;
|
||||
btree->fillRoot = entryFillRoot;
|
||||
btree->fillRoot = ginEntryFillRoot;
|
||||
|
||||
btree->isData = FALSE;
|
||||
btree->searchMode = FALSE;
|
||||
|
Reference in New Issue
Block a user