aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/spgist
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-06-21 15:35:54 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-06-21 15:35:54 -0400
commit382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch)
treef558251492f2c6f86e3566f7a82f9d00509122c2 /src/backend/access/spgist
parentc7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff)
downloadpostgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.tar.gz
postgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.zip
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/backend/access/spgist')
-rw-r--r--src/backend/access/spgist/spgdoinsert.c46
-rw-r--r--src/backend/access/spgist/spginsert.c2
-rw-r--r--src/backend/access/spgist/spgquadtreeproc.c4
-rw-r--r--src/backend/access/spgist/spgscan.c2
-rw-r--r--src/backend/access/spgist/spgutils.c4
-rw-r--r--src/backend/access/spgist/spgvacuum.c4
-rw-r--r--src/backend/access/spgist/spgxlog.c36
7 files changed, 49 insertions, 49 deletions
diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c
index 8c420633f42..b0702a7f927 100644
--- a/src/backend/access/spgist/spgdoinsert.c
+++ b/src/backend/access/spgist/spgdoinsert.c
@@ -189,7 +189,7 @@ saveNodeLink(Relation index, SPPageDesc *parent,
SpGistInnerTuple innerTuple;
innerTuple = (SpGistInnerTuple) PageGetItem(parent->page,
- PageGetItemId(parent->page, parent->offnum));
+ PageGetItemId(parent->page, parent->offnum));
spgUpdateNodeLink(innerTuple, parent->node, blkno, offnum);
@@ -201,7 +201,7 @@ saveNodeLink(Relation index, SPPageDesc *parent,
*/
static void
addLeafTuple(Relation index, SpGistState *state, SpGistLeafTuple leafTuple,
- SPPageDesc *current, SPPageDesc *parent, bool isNulls, bool isNew)
+ SPPageDesc *current, SPPageDesc *parent, bool isNulls, bool isNew)
{
spgxlogAddLeaf xlrec;
@@ -222,7 +222,7 @@ addLeafTuple(Relation index, SpGistState *state, SpGistLeafTuple leafTuple,
/* Tuple is not part of a chain */
leafTuple->nextOffset = InvalidOffsetNumber;
current->offnum = SpGistPageAddNewItem(state, current->page,
- (Item) leafTuple, leafTuple->size,
+ (Item) leafTuple, leafTuple->size,
NULL, false);
xlrec.offnumLeaf = current->offnum;
@@ -250,7 +250,7 @@ addLeafTuple(Relation index, SpGistState *state, SpGistLeafTuple leafTuple,
OffsetNumber offnum;
head = (SpGistLeafTuple) PageGetItem(current->page,
- PageGetItemId(current->page, current->offnum));
+ PageGetItemId(current->page, current->offnum));
if (head->tupstate == SPGIST_LIVE)
{
leafTuple->nextOffset = head->nextOffset;
@@ -263,7 +263,7 @@ addLeafTuple(Relation index, SpGistState *state, SpGistLeafTuple leafTuple,
* and set new second element
*/
head = (SpGistLeafTuple) PageGetItem(current->page,
- PageGetItemId(current->page, current->offnum));
+ PageGetItemId(current->page, current->offnum));
head->nextOffset = offnum;
xlrec.offnumLeaf = offnum;
@@ -467,7 +467,7 @@ moveLeafs(Relation index, SpGistState *state,
for (i = 0; i < nDelete; i++)
{
it = (SpGistLeafTuple) PageGetItem(current->page,
- PageGetItemId(current->page, toDelete[i]));
+ PageGetItemId(current->page, toDelete[i]));
Assert(it->tupstate == SPGIST_LIVE);
/*
@@ -505,7 +505,7 @@ moveLeafs(Relation index, SpGistState *state,
* be any concurrent scan so we need not provide a redirect.
*/
spgPageIndexMultiDelete(state, current->page, toDelete, nDelete,
- state->isBuild ? SPGIST_PLACEHOLDER : SPGIST_REDIRECT,
+ state->isBuild ? SPGIST_PLACEHOLDER : SPGIST_REDIRECT,
SPGIST_PLACEHOLDER,
nblkno, r);
@@ -570,7 +570,7 @@ setRedirectionTuple(SPPageDesc *current, OffsetNumber position,
SpGistDeadTuple dt;
dt = (SpGistDeadTuple) PageGetItem(current->page,
- PageGetItemId(current->page, position));
+ PageGetItemId(current->page, position));
Assert(dt->tupstate == SPGIST_REDIRECT);
Assert(ItemPointerGetBlockNumber(&dt->pointer) == SPGIST_METAPAGE_BLKNO);
ItemPointerSet(&dt->pointer, blkno, offnum);
@@ -754,7 +754,7 @@ doPickSplit(Relation index, SpGistState *state,
SpGistLeafTuple it;
it = (SpGistLeafTuple) PageGetItem(current->page,
- PageGetItemId(current->page, i));
+ PageGetItemId(current->page, i));
if (it->tupstate == SPGIST_LIVE)
{
in.datums[nToInsert] = SGLTDATUM(it, state);
@@ -779,7 +779,7 @@ doPickSplit(Relation index, SpGistState *state,
Assert(i >= FirstOffsetNumber && i <= max);
it = (SpGistLeafTuple) PageGetItem(current->page,
- PageGetItemId(current->page, i));
+ PageGetItemId(current->page, i));
if (it->tupstate == SPGIST_LIVE)
{
in.datums[nToInsert] = SGLTDATUM(it, state);
@@ -957,9 +957,9 @@ doPickSplit(Relation index, SpGistState *state,
{
/* Send tuple to page with next triple parity (see README) */
newInnerBuffer = SpGistGetBuffer(index,
- GBUF_INNER_PARITY(parent->blkno + 1) |
+ GBUF_INNER_PARITY(parent->blkno + 1) |
(isNulls ? GBUF_NULLS : 0),
- innerTuple->size + sizeof(ItemIdData),
+ innerTuple->size + sizeof(ItemIdData),
&xlrec.initInner);
}
else
@@ -1025,7 +1025,7 @@ doPickSplit(Relation index, SpGistState *state,
int newspace;
newLeafBuffer = SpGistGetBuffer(index,
- GBUF_LEAF | (isNulls ? GBUF_NULLS : 0),
+ GBUF_LEAF | (isNulls ? GBUF_NULLS : 0),
Min(totalLeafSizes,
SPGIST_PAGE_CAPACITY),
&xlrec.initDest);
@@ -1576,7 +1576,7 @@ spgAddNodeAction(Relation index, SpGistState *state,
*/
current->buffer = SpGistGetBuffer(index,
GBUF_INNER_PARITY(current->blkno),
- newInnerTuple->size + sizeof(ItemIdData),
+ newInnerTuple->size + sizeof(ItemIdData),
&xlrec.newPage);
current->blkno = BufferGetBlockNumber(current->buffer);
current->page = BufferGetPage(current->buffer);
@@ -1758,7 +1758,7 @@ spgSplitNodeAction(Relation index, SpGistState *state,
postfixTuple = spgFormInnerTuple(state,
out->result.splitTuple.postfixHasPrefix,
- out->result.splitTuple.postfixPrefixDatum,
+ out->result.splitTuple.postfixPrefixDatum,
innerTuple->nNodes, nodes);
/* Postfix tuple is allTheSame if original tuple was */
@@ -1834,7 +1834,7 @@ spgSplitNodeAction(Relation index, SpGistState *state,
spgUpdateNodeLink(prefixTuple, out->result.splitTuple.childNodeN,
postfixBlkno, postfixOffset);
prefixTuple = (SpGistInnerTuple) PageGetItem(current->page,
- PageGetItemId(current->page, current->offnum));
+ PageGetItemId(current->page, current->offnum));
spgUpdateNodeLink(prefixTuple, out->result.splitTuple.childNodeN,
postfixBlkno, postfixOffset);
@@ -1930,11 +1930,11 @@ spgdoinsert(Relation index, SpGistState *state,
if (leafSize > SPGIST_PAGE_CAPACITY && !state->config.longValuesOK)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
- leafSize - sizeof(ItemIdData),
- SPGIST_PAGE_CAPACITY - sizeof(ItemIdData),
- RelationGetRelationName(index)),
- errhint("Values larger than a buffer page cannot be indexed.")));
+ errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
+ leafSize - sizeof(ItemIdData),
+ SPGIST_PAGE_CAPACITY - sizeof(ItemIdData),
+ RelationGetRelationName(index)),
+ errhint("Values larger than a buffer page cannot be indexed.")));
/* Initialize "current" to the appropriate root page */
current.blkno = isnull ? SPGIST_NULL_BLKNO : SPGIST_ROOT_BLKNO;
@@ -2035,7 +2035,7 @@ spgdoinsert(Relation index, SpGistState *state,
}
else if ((sizeToSplit =
checkSplitConditions(index, state, &current,
- &nToSplit)) < SPGIST_PAGE_CAPACITY / 2 &&
+ &nToSplit)) < SPGIST_PAGE_CAPACITY / 2 &&
nToSplit < 64 &&
leafTuple->size + sizeof(ItemIdData) + sizeToSplit <= SPGIST_PAGE_CAPACITY)
{
@@ -2084,7 +2084,7 @@ spgdoinsert(Relation index, SpGistState *state,
CHECK_FOR_INTERRUPTS();
innerTuple = (SpGistInnerTuple) PageGetItem(current.page,
- PageGetItemId(current.page, current.offnum));
+ PageGetItemId(current.page, current.offnum));
in.datum = datum;
in.leafDatum = leafDatum;
diff --git a/src/backend/access/spgist/spginsert.c b/src/backend/access/spgist/spginsert.c
index 9a372599164..e4b2c29b0ed 100644
--- a/src/backend/access/spgist/spginsert.c
+++ b/src/backend/access/spgist/spginsert.c
@@ -134,7 +134,7 @@ spgbuild(Relation heap, Relation index, IndexInfo *indexInfo)
buildstate.spgstate.isBuild = true;
buildstate.tmpCtx = AllocSetContextCreate(CurrentMemoryContext,
- "SP-GiST build temporary context",
+ "SP-GiST build temporary context",
ALLOCSET_DEFAULT_SIZES);
reltuples = IndexBuildHeapScan(heap, index, indexInfo, true,
diff --git a/src/backend/access/spgist/spgquadtreeproc.c b/src/backend/access/spgist/spgquadtreeproc.c
index 6ad73f448d8..773774555fc 100644
--- a/src/backend/access/spgist/spgquadtreeproc.c
+++ b/src/backend/access/spgist/spgquadtreeproc.c
@@ -253,8 +253,8 @@ spg_quad_inner_consistent(PG_FUNCTION_ARGS)
boxQuery = DatumGetBoxP(in->scankeys[i].sk_argument);
if (DatumGetBool(DirectFunctionCall2(box_contain_pt,
- PointerGetDatum(boxQuery),
- PointerGetDatum(centroid))))
+ PointerGetDatum(boxQuery),
+ PointerGetDatum(centroid))))
{
/* centroid is in box, so all quadrants are OK */
}
diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c
index e1f9d872781..7965b5846d9 100644
--- a/src/backend/access/spgist/spgscan.c
+++ b/src/backend/access/spgist/spgscan.c
@@ -442,7 +442,7 @@ redirect:
MemoryContext oldCtx;
innerTuple = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, offset));
+ PageGetItemId(page, offset));
if (innerTuple->tupstate != SPGIST_LIVE)
{
diff --git a/src/backend/access/spgist/spgutils.c b/src/backend/access/spgist/spgutils.c
index e57ac49c6b4..8656af453c1 100644
--- a/src/backend/access/spgist/spgutils.c
+++ b/src/backend/access/spgist/spgutils.c
@@ -705,7 +705,7 @@ spgFormInnerTuple(SpGistState *state, bool hasPrefix, Datum prefix,
errmsg("SP-GiST inner tuple size %zu exceeds maximum %zu",
(Size) size,
SPGIST_PAGE_CAPACITY - sizeof(ItemIdData)),
- errhint("Values larger than a buffer page cannot be indexed.")));
+ errhint("Values larger than a buffer page cannot be indexed.")));
/*
* Check for overflow of header fields --- probably can't fail if the
@@ -848,7 +848,7 @@ SpGistPageAddNewItem(SpGistState *state, Page page, Item item, Size size,
for (; i <= maxoff; i++)
{
SpGistDeadTuple it = (SpGistDeadTuple) PageGetItem(page,
- PageGetItemId(page, i));
+ PageGetItemId(page, i));
if (it->tupstate == SPGIST_PLACEHOLDER)
{
diff --git a/src/backend/access/spgist/spgvacuum.c b/src/backend/access/spgist/spgvacuum.c
index 508d3e083fd..d7d5e90ef3a 100644
--- a/src/backend/access/spgist/spgvacuum.c
+++ b/src/backend/access/spgist/spgvacuum.c
@@ -750,7 +750,7 @@ spgprocesspending(spgBulkDeleteState *bds)
offset = ItemPointerGetOffsetNumber(&nitem->tid);
innerTuple = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, offset));
+ PageGetItemId(page, offset));
if (innerTuple->tupstate == SPGIST_LIVE)
{
SpGistNodeTuple node;
@@ -766,7 +766,7 @@ spgprocesspending(spgBulkDeleteState *bds)
{
/* transfer attention to redirect point */
spgAddPendingTID(bds,
- &((SpGistDeadTuple) innerTuple)->pointer);
+ &((SpGistDeadTuple) innerTuple)->pointer);
}
else
elog(ERROR, "unexpected SPGiST tuple state: %d",
diff --git a/src/backend/access/spgist/spgxlog.c b/src/backend/access/spgist/spgxlog.c
index c007601efde..c440d217159 100644
--- a/src/backend/access/spgist/spgxlog.c
+++ b/src/backend/access/spgist/spgxlog.c
@@ -54,7 +54,7 @@ addOrReplaceTuple(Page page, Item tuple, int size, OffsetNumber offset)
if (offset <= PageGetMaxOffsetNumber(page))
{
SpGistDeadTuple dt = (SpGistDeadTuple) PageGetItem(page,
- PageGetItemId(page, offset));
+ PageGetItemId(page, offset));
if (dt->tupstate != SPGIST_PLACEHOLDER)
elog(ERROR, "SPGiST tuple to be replaced is not a placeholder");
@@ -130,7 +130,7 @@ spgRedoAddLeaf(XLogReaderState *record)
{
buffer = XLogInitBufferForRedo(record, 0);
SpGistInitBuffer(buffer,
- SPGIST_LEAF | (xldata->storesNulls ? SPGIST_NULLS : 0));
+ SPGIST_LEAF | (xldata->storesNulls ? SPGIST_NULLS : 0));
action = BLK_NEEDS_REDO;
}
else
@@ -153,7 +153,7 @@ spgRedoAddLeaf(XLogReaderState *record)
SpGistLeafTuple head;
head = (SpGistLeafTuple) PageGetItem(page,
- PageGetItemId(page, xldata->offnumHeadLeaf));
+ PageGetItemId(page, xldata->offnumHeadLeaf));
Assert(head->nextOffset == leafTupleHdr.nextOffset);
head->nextOffset = xldata->offnumLeaf;
}
@@ -164,7 +164,7 @@ spgRedoAddLeaf(XLogReaderState *record)
PageIndexTupleDelete(page, xldata->offnumLeaf);
if (PageAddItem(page,
(Item) leafTuple, leafTupleHdr.size,
- xldata->offnumLeaf, false, false) != xldata->offnumLeaf)
+ xldata->offnumLeaf, false, false) != xldata->offnumLeaf)
elog(ERROR, "failed to add item of size %u to SPGiST index page",
leafTupleHdr.size);
}
@@ -188,7 +188,7 @@ spgRedoAddLeaf(XLogReaderState *record)
page = BufferGetPage(buffer);
tuple = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, xldata->offnumParent));
+ PageGetItemId(page, xldata->offnumParent));
spgUpdateNodeLink(tuple, xldata->nodeI,
blknoLeaf, xldata->offnumLeaf);
@@ -241,7 +241,7 @@ spgRedoMoveLeafs(XLogReaderState *record)
{
buffer = XLogInitBufferForRedo(record, 1);
SpGistInitBuffer(buffer,
- SPGIST_LEAF | (xldata->storesNulls ? SPGIST_NULLS : 0));
+ SPGIST_LEAF | (xldata->storesNulls ? SPGIST_NULLS : 0));
action = BLK_NEEDS_REDO;
}
else
@@ -283,7 +283,7 @@ spgRedoMoveLeafs(XLogReaderState *record)
page = BufferGetPage(buffer);
spgPageIndexMultiDelete(&state, page, toDelete, xldata->nMoves,
- state.isBuild ? SPGIST_PLACEHOLDER : SPGIST_REDIRECT,
+ state.isBuild ? SPGIST_PLACEHOLDER : SPGIST_REDIRECT,
SPGIST_PLACEHOLDER,
blknoDst,
toInsert[nInsert - 1]);
@@ -302,7 +302,7 @@ spgRedoMoveLeafs(XLogReaderState *record)
page = BufferGetPage(buffer);
tuple = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, xldata->offnumParent));
+ PageGetItemId(page, xldata->offnumParent));
spgUpdateNodeLink(tuple, xldata->nodeI,
blknoDst, toInsert[nInsert - 1]);
@@ -396,7 +396,7 @@ spgRedoAddNode(XLogReaderState *record)
SpGistInnerTuple parentTuple;
parentTuple = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, xldata->offnumParent));
+ PageGetItemId(page, xldata->offnumParent));
spgUpdateNodeLink(parentTuple, xldata->nodeI,
blknoNew, xldata->offnumNew);
@@ -443,7 +443,7 @@ spgRedoAddNode(XLogReaderState *record)
SpGistInnerTuple parentTuple;
parentTuple = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, xldata->offnumParent));
+ PageGetItemId(page, xldata->offnumParent));
spgUpdateNodeLink(parentTuple, xldata->nodeI,
blknoNew, xldata->offnumNew);
@@ -467,7 +467,7 @@ spgRedoAddNode(XLogReaderState *record)
page = BufferGetPage(buffer);
parentTuple = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, xldata->offnumParent));
+ PageGetItemId(page, xldata->offnumParent));
spgUpdateNodeLink(parentTuple, xldata->nodeI,
blknoNew, xldata->offnumNew);
@@ -543,7 +543,7 @@ spgRedoSplitTuple(XLogReaderState *record)
PageIndexTupleDelete(page, xldata->offnumPrefix);
if (PageAddItem(page, (Item) prefixTuple, prefixTupleHdr.size,
- xldata->offnumPrefix, false, false) != xldata->offnumPrefix)
+ xldata->offnumPrefix, false, false) != xldata->offnumPrefix)
elog(ERROR, "failed to add item of size %u to SPGiST index page",
prefixTupleHdr.size);
@@ -613,7 +613,7 @@ spgRedoPickSplit(XLogReaderState *record)
srcPage = (Page) BufferGetPage(srcBuffer);
SpGistInitBuffer(srcBuffer,
- SPGIST_LEAF | (xldata->storesNulls ? SPGIST_NULLS : 0));
+ SPGIST_LEAF | (xldata->storesNulls ? SPGIST_NULLS : 0));
/* don't update LSN etc till we're done with it */
}
else
@@ -666,7 +666,7 @@ spgRedoPickSplit(XLogReaderState *record)
destPage = (Page) BufferGetPage(destBuffer);
SpGistInitBuffer(destBuffer,
- SPGIST_LEAF | (xldata->storesNulls ? SPGIST_NULLS : 0));
+ SPGIST_LEAF | (xldata->storesNulls ? SPGIST_NULLS : 0));
/* don't update LSN etc till we're done with it */
}
else
@@ -735,7 +735,7 @@ spgRedoPickSplit(XLogReaderState *record)
SpGistInnerTuple parent;
parent = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, xldata->offnumParent));
+ PageGetItemId(page, xldata->offnumParent));
spgUpdateNodeLink(parent, xldata->nodeI,
blknoInner, xldata->offnumInner);
}
@@ -767,7 +767,7 @@ spgRedoPickSplit(XLogReaderState *record)
page = BufferGetPage(parentBuffer);
parent = (SpGistInnerTuple) PageGetItem(page,
- PageGetItemId(page, xldata->offnumParent));
+ PageGetItemId(page, xldata->offnumParent));
spgUpdateNodeLink(parent, xldata->nodeI,
blknoInner, xldata->offnumInner);
@@ -852,7 +852,7 @@ spgRedoVacuumLeaf(XLogReaderState *record)
SpGistLeafTuple lt;
lt = (SpGistLeafTuple) PageGetItem(page,
- PageGetItemId(page, chainSrc[i]));
+ PageGetItemId(page, chainSrc[i]));
Assert(lt->tupstate == SPGIST_LIVE);
lt->nextOffset = chainDest[i];
}
@@ -929,7 +929,7 @@ spgRedoVacuumRedirect(XLogReaderState *record)
SpGistDeadTuple dt;
dt = (SpGistDeadTuple) PageGetItem(page,
- PageGetItemId(page, itemToPlaceholder[i]));
+ PageGetItemId(page, itemToPlaceholder[i]));
Assert(dt->tupstate == SPGIST_REDIRECT);
dt->tupstate = SPGIST_PLACEHOLDER;
ItemPointerSetInvalid(&dt->pointer);