diff options
author | Bruce Momjian <bruce@momjian.us> | 2012-06-10 15:20:04 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2012-06-10 15:20:04 -0400 |
commit | 927d61eeff78363ea3938c818d07e511ebaf75cf (patch) | |
tree | 2f0bcecf53327f76272a8ce690fa62505520fab9 /src/backend/access/gist | |
parent | 60801944fa105252b48ea5688d47dfc05c695042 (diff) | |
download | postgresql-927d61eeff78363ea3938c818d07e511ebaf75cf.tar.gz postgresql-927d61eeff78363ea3938c818d07e511ebaf75cf.zip |
Run pgindent on 9.2 source tree in preparation for first 9.3
commit-fest.
Diffstat (limited to 'src/backend/access/gist')
-rw-r--r-- | src/backend/access/gist/gist.c | 12 | ||||
-rw-r--r-- | src/backend/access/gist/gistbuild.c | 69 | ||||
-rw-r--r-- | src/backend/access/gist/gistbuildbuffers.c | 2 | ||||
-rw-r--r-- | src/backend/access/gist/gistproc.c | 6 | ||||
-rw-r--r-- | src/backend/access/gist/gistscan.c | 2 | ||||
-rw-r--r-- | src/backend/access/gist/gistsplit.c | 3 |
6 files changed, 48 insertions, 46 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 1efaaee1a86..783590ea55e 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -27,7 +27,7 @@ /* non-export function prototypes */ static void gistfixsplit(GISTInsertState *state, GISTSTATE *giststate); static bool gistinserttuple(GISTInsertState *state, GISTInsertStack *stack, - GISTSTATE *giststate, IndexTuple tuple, OffsetNumber oldoffnum); + GISTSTATE *giststate, IndexTuple tuple, OffsetNumber oldoffnum); static bool gistinserttuples(GISTInsertState *state, GISTInsertStack *stack, GISTSTATE *giststate, IndexTuple *tuples, int ntup, OffsetNumber oldoffnum, @@ -781,8 +781,8 @@ gistFindPath(Relation r, BlockNumber child, OffsetNumber *downlinkoffnum) { /* * Page was split while we looked elsewhere. We didn't see the - * downlink to the right page when we scanned the parent, so - * add it to the queue now. + * downlink to the right page when we scanned the parent, so add + * it to the queue now. * * Put the right page ahead of the queue, so that we visit it * next. That's important, because if this is the lowest internal @@ -829,7 +829,7 @@ gistFindPath(Relation r, BlockNumber child, OffsetNumber *downlinkoffnum) elog(ERROR, "failed to re-find parent of a page in index \"%s\", block %u", RelationGetRelationName(r), child); - return NULL; /* keep compiler quiet */ + return NULL; /* keep compiler quiet */ } /* @@ -1046,7 +1046,7 @@ gistfixsplit(GISTInsertState *state, GISTSTATE *giststate) */ static bool gistinserttuple(GISTInsertState *state, GISTInsertStack *stack, - GISTSTATE *giststate, IndexTuple tuple, OffsetNumber oldoffnum) + GISTSTATE *giststate, IndexTuple tuple, OffsetNumber oldoffnum) { return gistinserttuples(state, stack, giststate, &tuple, 1, oldoffnum, InvalidBuffer, InvalidBuffer, false, false); @@ -1308,7 +1308,7 @@ initGISTstate(Relation index) giststate = (GISTSTATE *) palloc(sizeof(GISTSTATE)); giststate->scanCxt = scanCxt; - giststate->tempCxt = scanCxt; /* caller must change this if needed */ + giststate->tempCxt = scanCxt; /* caller must change this if needed */ giststate->tupdesc = index->rd_att; for (i = 0; i < index->rd_att->natts; i++) diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c index 712e59ac908..8caf4856763 100644 --- a/src/backend/access/gist/gistbuild.c +++ b/src/backend/access/gist/gistbuild.c @@ -48,7 +48,7 @@ typedef enum * before switching to the buffering build * mode */ GIST_BUFFERING_ACTIVE /* in buffering build mode */ -} GistBufferingMode; +} GistBufferingMode; /* Working state for gistbuild and its callback */ typedef struct @@ -263,7 +263,7 @@ gistValidateBufferingOption(char *value) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("invalid value for \"buffering\" option"), - errdetail("Valid values are \"on\", \"off\", and \"auto\"."))); + errdetail("Valid values are \"on\", \"off\", and \"auto\"."))); } } @@ -567,7 +567,7 @@ gistProcessItup(GISTBuildState *buildstate, IndexTuple itup, BlockNumber childblkno; Buffer buffer; bool result = false; - BlockNumber blkno; + BlockNumber blkno; int level; OffsetNumber downlinkoffnum = InvalidOffsetNumber; BlockNumber parentblkno = InvalidBlockNumber; @@ -623,7 +623,7 @@ gistProcessItup(GISTBuildState *buildstate, IndexTuple itup, { gistbufferinginserttuples(buildstate, buffer, level, &newtup, 1, childoffnum, - InvalidBlockNumber, InvalidOffsetNumber); + InvalidBlockNumber, InvalidOffsetNumber); /* gistbufferinginserttuples() released the buffer */ } else @@ -716,26 +716,26 @@ gistbufferinginserttuples(GISTBuildState *buildstate, Buffer buffer, int level, /* * All the downlinks on the old root page are now on one of the child - * pages. Visit all the new child pages to memorize the parents of - * the grandchildren. + * pages. Visit all the new child pages to memorize the parents of the + * grandchildren. */ if (gfbb->rootlevel > 1) { maxoff = PageGetMaxOffsetNumber(page); for (off = FirstOffsetNumber; off <= maxoff; off++) { - ItemId iid = PageGetItemId(page, off); - IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid); + ItemId iid = PageGetItemId(page, off); + IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid); BlockNumber childblkno = ItemPointerGetBlockNumber(&(idxtuple->t_tid)); - Buffer childbuf = ReadBuffer(buildstate->indexrel, childblkno); + Buffer childbuf = ReadBuffer(buildstate->indexrel, childblkno); LockBuffer(childbuf, GIST_SHARE); gistMemorizeAllDownlinks(buildstate, childbuf); UnlockReleaseBuffer(childbuf); /* - * Also remember that the parent of the new child page is - * the root block. + * Also remember that the parent of the new child page is the + * root block. */ gistMemorizeParent(buildstate, childblkno, GIST_ROOT_BLKNO); } @@ -789,8 +789,8 @@ gistbufferinginserttuples(GISTBuildState *buildstate, Buffer buffer, int level, * Remember the parent of each new child page in our parent map. * This assumes that the downlinks fit on the parent page. If the * parent page is split, too, when we recurse up to insert the - * downlinks, the recursive gistbufferinginserttuples() call - * will update the map again. + * downlinks, the recursive gistbufferinginserttuples() call will + * update the map again. */ if (level > 0) gistMemorizeParent(buildstate, @@ -879,8 +879,9 @@ gistBufferingFindCorrectParent(GISTBuildState *buildstate, if (parent == *parentblkno && *parentblkno != InvalidBlockNumber && *downlinkoffnum != InvalidOffsetNumber && *downlinkoffnum <= maxoff) { - ItemId iid = PageGetItemId(page, *downlinkoffnum); - IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid); + ItemId iid = PageGetItemId(page, *downlinkoffnum); + IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid); + if (ItemPointerGetBlockNumber(&(idxtuple->t_tid)) == childblkno) { /* Still there */ @@ -889,16 +890,17 @@ gistBufferingFindCorrectParent(GISTBuildState *buildstate, } /* - * Downlink was not at the offset where it used to be. Scan the page - * to find it. During normal gist insertions, it might've moved to another - * page, to the right, but during a buffering build, we keep track of - * the parent of each page in the lookup table so we should always know - * what page it's on. + * Downlink was not at the offset where it used to be. Scan the page to + * find it. During normal gist insertions, it might've moved to another + * page, to the right, but during a buffering build, we keep track of the + * parent of each page in the lookup table so we should always know what + * page it's on. */ for (off = FirstOffsetNumber; off <= maxoff; off = OffsetNumberNext(off)) { - ItemId iid = PageGetItemId(page, off); - IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid); + ItemId iid = PageGetItemId(page, off); + IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid); + if (ItemPointerGetBlockNumber(&(idxtuple->t_tid)) == childblkno) { /* yes!!, found it */ @@ -908,7 +910,7 @@ gistBufferingFindCorrectParent(GISTBuildState *buildstate, } elog(ERROR, "failed to re-find parent for block %u", childblkno); - return InvalidBuffer; /* keep compiler quiet */ + return InvalidBuffer; /* keep compiler quiet */ } /* @@ -1129,7 +1131,7 @@ gistGetMaxLevel(Relation index) typedef struct { - BlockNumber childblkno; /* hash key */ + BlockNumber childblkno; /* hash key */ BlockNumber parentblkno; } ParentMapEntry; @@ -1156,9 +1158,9 @@ gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child, BlockNumber pa bool found; entry = (ParentMapEntry *) hash_search(buildstate->parentMap, - (const void *) &child, - HASH_ENTER, - &found); + (const void *) &child, + HASH_ENTER, + &found); entry->parentblkno = parent; } @@ -1171,16 +1173,17 @@ gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parentbuf) OffsetNumber maxoff; OffsetNumber off; BlockNumber parentblkno = BufferGetBlockNumber(parentbuf); - Page page = BufferGetPage(parentbuf); + Page page = BufferGetPage(parentbuf); Assert(!GistPageIsLeaf(page)); maxoff = PageGetMaxOffsetNumber(page); for (off = FirstOffsetNumber; off <= maxoff; off++) { - ItemId iid = PageGetItemId(page, off); - IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid); + ItemId iid = PageGetItemId(page, off); + IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid); BlockNumber childblkno = ItemPointerGetBlockNumber(&(idxtuple->t_tid)); + gistMemorizeParent(buildstate, childblkno, parentblkno); } } @@ -1193,9 +1196,9 @@ gistGetParent(GISTBuildState *buildstate, BlockNumber child) /* Find node buffer in hash table */ entry = (ParentMapEntry *) hash_search(buildstate->parentMap, - (const void *) &child, - HASH_FIND, - &found); + (const void *) &child, + HASH_FIND, + &found); if (!found) elog(ERROR, "could not find parent of block %d in lookup table", child); diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c index 3feca263a76..39aec856f92 100644 --- a/src/backend/access/gist/gistbuildbuffers.c +++ b/src/backend/access/gist/gistbuildbuffers.c @@ -528,7 +528,7 @@ typedef struct bool isnull[INDEX_MAX_KEYS]; GISTPageSplitInfo *splitinfo; GISTNodeBuffer *nodeBuffer; -} RelocationBufferInfo; +} RelocationBufferInfo; /* * At page split, distribute tuples from the buffer of the split page to diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c index d97c64ede3f..09e911d0981 100644 --- a/src/backend/access/gist/gistproc.c +++ b/src/backend/access/gist/gistproc.c @@ -244,7 +244,7 @@ typedef struct int index; /* Delta between penalties of entry insertion into different groups */ double delta; -} CommonEntry; +} CommonEntry; /* * Context for g_box_consider_split. Contains information about currently @@ -267,7 +267,7 @@ typedef struct int dim; /* axis of this split */ double range; /* width of general MBR projection to the * selected axis */ -} ConsiderSplitContext; +} ConsiderSplitContext; /* * Interval represents projection of box to axis. @@ -276,7 +276,7 @@ typedef struct { double lower, upper; -} SplitInterval; +} SplitInterval; /* * Interval comparison function by lower bound of the interval; diff --git a/src/backend/access/gist/gistscan.c b/src/backend/access/gist/gistscan.c index bf139de8246..c9fc9ba97f9 100644 --- a/src/backend/access/gist/gistscan.c +++ b/src/backend/access/gist/gistscan.c @@ -124,7 +124,7 @@ gistbeginscan(PG_FUNCTION_ARGS) so->giststate = giststate; giststate->tempCxt = createTempGistContext(); so->queue = NULL; - so->queueCxt = giststate->scanCxt; /* see gistrescan */ + so->queueCxt = giststate->scanCxt; /* see gistrescan */ /* workspaces with size dependent on numberOfOrderBys: */ so->tmpTreeItem = palloc(GSTIHDRSZ + sizeof(double) * scan->numberOfOrderBys); diff --git a/src/backend/access/gist/gistsplit.c b/src/backend/access/gist/gistsplit.c index 2ec69a60d45..739fc597ceb 100644 --- a/src/backend/access/gist/gistsplit.c +++ b/src/backend/access/gist/gistsplit.c @@ -581,8 +581,7 @@ gistSplitByKey(Relation r, Page page, IndexTuple *itup, int len, GISTSTATE *gist if (v->spl_equiv == NULL) { /* - * simple case: left and right keys for attno column are - * equal + * simple case: left and right keys for attno column are equal */ gistSplitByKey(r, page, itup, len, giststate, v, entryvec, attno + 1); } |