1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

OK, folks, here is the pgindent output.

This commit is contained in:
Bruce Momjian
1998-09-01 04:40:42 +00:00
parent af74855a60
commit fa1a8d6a97
574 changed files with 26509 additions and 24033 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.40 1998/09/01 03:20:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.41 1998/09/01 04:26:39 momjian Exp $
*
* NOTES
* The old interface functions have been converted to macros
@@ -935,7 +935,8 @@ heap_modifytuple(HeapTuple tuple,
(char *) &tuple->t_oid,
((char *) &tuple->t_hoff - (char *) &tuple->t_oid)); /* XXX */
newTuple->t_infomask = infomask;
newTuple->t_natts = numberOfAttributes; /* fix t_natts just in case */
newTuple->t_natts = numberOfAttributes; /* fix t_natts just in
* case */
return newTuple;
}

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.34 1998/09/01 03:20:45 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.35 1998/09/01 04:26:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -82,8 +82,10 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
Datum attr;
bool isnull;
Oid typoutput;
#ifdef MULTIBYTE
unsigned char *p;
#endif
/* ----------------
@@ -147,7 +149,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
outputstr = "<unprintable>";
pq_putint(strlen(outputstr) + VARHDRSZ, VARHDRSZ);
pq_putnchar(outputstr, strlen(outputstr));
}
}
}
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.43 1998/09/01 03:20:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.44 1998/09/01 04:26:41 momjian Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -75,7 +75,7 @@ CreateTemplateTupleDesc(int natts)
* ----------------------------------------------------------------
*/
TupleDesc
CreateTupleDesc(int natts, Form_pg_attribute *attrs)
CreateTupleDesc(int natts, Form_pg_attribute * attrs)
{
TupleDesc desc;

View File

@@ -33,42 +33,32 @@
#endif
/* non-export function prototypes */
static InsertIndexResult
gistdoinsert(Relation r, IndexTuple itup,
static InsertIndexResult gistdoinsert(Relation r, IndexTuple itup,
GISTSTATE *GISTstate);
static InsertIndexResult
gistentryinsert(Relation r, GISTSTACK *stk,
static InsertIndexResult gistentryinsert(Relation r, GISTSTACK *stk,
IndexTuple tup,
GISTSTATE *giststate);
static void
gistentryinserttwo(Relation r, GISTSTACK *stk, IndexTuple ltup,
static void gistentryinserttwo(Relation r, GISTSTACK *stk, IndexTuple ltup,
IndexTuple rtup, GISTSTATE *giststate);
static void
gistAdjustKeys(Relation r, GISTSTACK *stk, BlockNumber blk,
static void gistAdjustKeys(Relation r, GISTSTACK *stk, BlockNumber blk,
char *datum, int att_size, GISTSTATE *giststate);
static void
gistintinsert(Relation r, GISTSTACK *stk, IndexTuple ltup,
static void gistintinsert(Relation r, GISTSTACK *stk, IndexTuple ltup,
IndexTuple rtup, GISTSTATE *giststate);
static InsertIndexResult
gistSplit(Relation r, Buffer buffer,
static InsertIndexResult gistSplit(Relation r, Buffer buffer,
GISTSTACK *stack, IndexTuple itup,
GISTSTATE *giststate);
static void
gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple lt,
static void gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple lt,
IndexTuple rt);
static void GISTInitBuffer(Buffer b, uint32 f);
static BlockNumber
gistChooseSubtree(Relation r, IndexTuple itup, int level,
static BlockNumber gistChooseSubtree(Relation r, IndexTuple itup, int level,
GISTSTATE *giststate,
GISTSTACK **retstack, Buffer *leafbuf);
static OffsetNumber
gistchoose(Relation r, Page p, IndexTuple it,
static OffsetNumber gistchoose(Relation r, Page p, IndexTuple it,
GISTSTATE *giststate);
static int gistnospace(Page p, IndexTuple it);
void gistdelete(Relation r, ItemPointer tid);
static IndexTuple gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t);
static void
gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
static void gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
Relation r, Page pg, OffsetNumber o, int b, bool l);
static char *int_range_out(INTRANGE *r);
@@ -169,7 +159,7 @@ gistbuild(Relation heap,
slot = NULL;
econtext = NULL;
}
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
/* int the tuples as we insert them */
nh = ni = 0;
@@ -193,7 +183,7 @@ gistbuild(Relation heap,
ni++;
continue;
}
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
/*
@@ -207,7 +197,7 @@ gistbuild(Relation heap,
slot->val = htup;
if (ExecQual((List *) pred, econtext) == false)
continue;
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
ni++;
@@ -286,7 +276,7 @@ gistbuild(Relation heap,
#ifndef OMIT_PARTIAL_INDEX
ExecDestroyTupleTable(tupleTable, true);
pfree(econtext);
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
/*
@@ -1168,7 +1158,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
itupform = (Form_pg_index) GETSTRUCT(htup);
if (!HeapTupleIsValid(htup))
elog(ERROR, "initGISTstate: index %d not found",
RelationGetRelid(index));
RelationGetRelid(index));
giststate->haskeytype = itupform->indhaskeytype;
if (giststate->haskeytype)
{
@@ -1377,4 +1367,4 @@ int_range_out(INTRANGE *r)
return result;
}
#endif /* defined GISTDEBUG */
#endif /* defined GISTDEBUG */

View File

@@ -28,15 +28,13 @@
#endif
static OffsetNumber
gistfindnext(IndexScanDesc s, Page p, OffsetNumber n,
static OffsetNumber gistfindnext(IndexScanDesc s, Page p, OffsetNumber n,
ScanDirection dir);
static RetrieveIndexResult gistscancache(IndexScanDesc s, ScanDirection dir);
static RetrieveIndexResult gistfirst(IndexScanDesc s, ScanDirection dir);
static RetrieveIndexResult gistnext(IndexScanDesc s, ScanDirection dir);
static ItemPointer gistheapptr(Relation r, ItemPointer itemp);
static bool
gistindex_keytest(IndexTuple tuple, TupleDesc tupdesc,
static bool gistindex_keytest(IndexTuple tuple, TupleDesc tupdesc,
int scanKeySize, ScanKey key, GISTSTATE *giststate,
Relation r, Page p, OffsetNumber offset);

View File

@@ -29,14 +29,11 @@
/* routines defined and used here */
static void gistregscan(IndexScanDesc s);
static void gistdropscan(IndexScanDesc s);
static void
gistadjone(IndexScanDesc s, int op, BlockNumber blkno,
static void gistadjone(IndexScanDesc s, int op, BlockNumber blkno,
OffsetNumber offnum);
static void
adjuststack(GISTSTACK *stk, BlockNumber blkno,
static void adjuststack(GISTSTACK *stk, BlockNumber blkno,
OffsetNumber offnum);
static void
adjustiptr(IndexScanDesc s, ItemPointer iptr,
static void adjustiptr(IndexScanDesc s, ItemPointer iptr,
int op, BlockNumber blkno, OffsetNumber offnum);
/*

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.21 1998/09/01 03:20:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.22 1998/09/01 04:26:48 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
@@ -118,7 +118,7 @@ hashbuild(Relation heap,
tupleTable = 0;
slot = 0;
}
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
/* build the index */
nhtups = nitups = 0;
@@ -145,7 +145,7 @@ hashbuild(Relation heap,
nitups++;
continue;
}
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
/*
@@ -159,7 +159,7 @@ hashbuild(Relation heap,
slot->val = htup;
if (ExecQual((List *) pred, econtext) == false)
continue;
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
nitups++;
@@ -232,7 +232,7 @@ hashbuild(Relation heap,
#ifndef OMIT_PARTIAL_INDEX
ExecDestroyTupleTable(tupleTable, true);
pfree(econtext);
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
/*

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.11 1998/09/01 03:20:54 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.12 1998/09/01 04:26:49 momjian Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
@@ -136,11 +136,11 @@ hashoid(Oid key)
uint32
hashoid8(Oid *key)
{
int i;
uint32 result = 0;
int i;
uint32 result = 0;
for (i=0; i < 8; i++)
result = result ^ (~(uint32)key[i]);
for (i = 0; i < 8; i++)
result = result ^ (~(uint32) key[i]);
return result;
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.34 1998/09/01 03:21:05 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.35 1998/09/01 04:26:51 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -109,10 +109,10 @@ static bool ImmediateInvalidation;
*/
static void
initscan(HeapScanDesc scan,
Relation relation,
int atend,
unsigned nkeys,
ScanKey key)
Relation relation,
int atend,
unsigned nkeys,
ScanKey key)
{
if (!RelationGetNumberOfBlocks(relation))
{
@@ -258,7 +258,7 @@ heapgettup(Relation relation,
elog(DEBUG, "heapgettup: relation(%c)=`%s', %p",
relation->rd_rel->relkind, &relation->rd_rel->relname,
snapshot);
#endif /* !defined(HEAPDEBUGALL) */
#endif /* !defined(HEAPDEBUGALL) */
if (!ItemPointerIsValid(tid))
Assert(!PointerIsValid(tid));
@@ -283,12 +283,12 @@ heapgettup(Relation relation,
/* assume it is a valid TID XXX */
if (ItemPointerIsValid(tid) == false)
{
*buf= InvalidBuffer;
*buf = InvalidBuffer;
return NULL;
}
*buf = RelationGetBufferWithBuffer(relation,
ItemPointerGetBlockNumber(tid),
*buf);
ItemPointerGetBlockNumber(tid),
*buf);
#ifndef NO_BUFFERISVALID
if (!BufferIsValid(*buf))
@@ -414,6 +414,7 @@ heapgettup(Relation relation,
if (ItemPointerGetBlockNumber(iptr) != page)
{
/*
* set block id to the correct page number --- this is
* a hack to support the virtual fragment concept
@@ -762,7 +763,7 @@ elog(DEBUG, "heap_getnext([%s,nkeys=%d],backw=%d) called", \
#define HEAPDEBUG_5
#define HEAPDEBUG_6
#define HEAPDEBUG_7
#endif /* !defined(HEAPDEBUGALL) */
#endif /* !defined(HEAPDEBUGALL) */
HeapTuple
@@ -990,7 +991,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
* value, and they are required to BuffferRelease() it when they
* are done. If they want to make a copy of it before releasing it,
* they can call heap_copytyple().
* ----------------
*/
HeapTuple
@@ -1005,8 +1006,8 @@ heap_fetch(Relation relation,
HeapTuple tuple;
OffsetNumber offnum;
AssertMacro(PointerIsValid(userbuf)); /* see comments above */
AssertMacro(PointerIsValid(userbuf)); /* see comments above */
/* ----------------
* increment access statistics
* ----------------
@@ -1074,7 +1075,8 @@ heap_fetch(Relation relation,
* ----------------
*/
*userbuf = buffer; /* user is required to ReleaseBuffer() this */
*userbuf = buffer; /* user is required to ReleaseBuffer()
* this */
return tuple;
}
@@ -1193,7 +1195,7 @@ heap_delete(Relation relation, ItemPointer tid)
{ /* XXX L_SH better ??? */
elog(ERROR, "heap_delete: failed ReadBuffer");
}
#endif /* NO_BUFFERISVALID */
#endif /* NO_BUFFERISVALID */
dp = (PageHeader) BufferGetPage(buf);
lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(tid));
@@ -1206,10 +1208,11 @@ heap_delete(Relation relation, ItemPointer tid)
Assert(HeapTupleIsValid(tp));
if (TupleUpdatedByCurXactAndCmd(tp))
{
/*
Vadim says this is no longer needed 1998/6/15
elog(NOTICE, "Non-functional delete, tuple already deleted");
*/
* Vadim says this is no longer needed 1998/6/15 elog(NOTICE,
* "Non-functional delete, tuple already deleted");
*/
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
RelationUnsetLockForWrite(relation);
ReleaseBuffer(buf);
@@ -1309,7 +1312,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple replace_tuple)
/* XXX L_SH better ??? */
elog(ERROR, "amreplace: failed ReadBuffer");
}
#endif /* NO_BUFFERISVALID */
#endif /* NO_BUFFERISVALID */
dp = (Page) BufferGetPage(buffer);
lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(otid));

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.24 1998/09/01 03:21:09 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.25 1998/09/01 04:26:55 momjian Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relationId
@@ -112,7 +112,7 @@
CppAsString(x), CppAsString(y)) \
: (void)NULL \
)
#define GET_SCAN_PROCEDURE(x,y) \
( \
procedure = scan->relation->rd_am->y, \
@@ -331,7 +331,7 @@ index_getnext(IndexScanDesc scan,
* have the am's gettuple proc do all the work.
* ----------------
*/
result = (RetrieveIndexResult)fmgr(procedure, scan, direction);
result = (RetrieveIndexResult) fmgr(procedure, scan, direction);
return result;
}

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.27 1998/09/01 03:21:10 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.28 1998/09/01 04:26:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -29,16 +29,13 @@
#ifdef USE_ASSERT_CHECKING
static bool StrategyEvaluationIsValid(StrategyEvaluation evaluation);
static bool
StrategyExpressionIsValid(StrategyExpression expression,
static bool StrategyExpressionIsValid(StrategyExpression expression,
StrategyNumber maxStrategy);
static ScanKey StrategyMapGetScanKeyEntry(StrategyMap map,
StrategyNumber strategyNumber);
static bool
StrategyOperatorIsValid(StrategyOperator operator,
static bool StrategyOperatorIsValid(StrategyOperator operator,
StrategyNumber maxStrategy);
static bool
StrategyTermIsValid(StrategyTerm term,
static bool StrategyTermIsValid(StrategyTerm term,
StrategyNumber maxStrategy);
#endif
@@ -378,8 +375,8 @@ RelationInvokeStrategy(Relation relation,
termData.degree = 1;
strategyMap = IndexStrategyGetStrategyMap(RelationGetIndexStrategy(relation),
evaluation->maxStrategy,
attributeNumber);
evaluation->maxStrategy,
attributeNumber);
entry = StrategyMapGetScanKeyEntry(strategyMap, strategy);
@@ -456,9 +453,7 @@ RelationInvokeStrategy(Relation relation,
}
if (index == (*termP)->degree)
{
return StrategyTermEvaluate(*termP, strategyMap, left, right);
}
termP += 1;
}
@@ -494,7 +489,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
else
{
ScanKeyData scanKeyData;
ScanKeyEntryInitialize(&scanKeyData, 0,
ObjectIdAttributeNumber,
F_OIDEQ,
@@ -502,7 +497,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
scan = heap_beginscan(operatorRelation, false, SnapshotNow,
1, &scanKeyData);
tuple = heap_getnext(scan, 0);
}
@@ -521,7 +516,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
if (IsBootstrapProcessingMode())
heap_endscan(scan);
if (!RegProcedureIsValid(entry->sk_procedure))
{
elog(ERROR,
@@ -565,7 +560,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
ScanKeyEntryInitialize(&entry[0], 0, Anum_pg_index_indexrelid,
F_OIDEQ,
ObjectIdGetDatum(indexObjectId));
relation = heap_openr(IndexRelationName);
scan = heap_beginscan(relation, false, SnapshotNow, 1, entry);
tuple = heap_getnext(scan, 0);
@@ -601,7 +596,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
heap_endscan(scan);
heap_close(relation);
}
/* if support routines exist for this access method, load them */
if (maxSupportNumber > 0)
{
@@ -615,7 +610,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
relation = heap_openr(AccessMethodProcedureRelationName);
for (attributeNumber = 1; attributeNumber <= maxAttributeNumber;
attributeNumber++)
attributeNumber++)
{
int16 support;
Form_pg_amproc form;
@@ -723,4 +718,4 @@ IndexStrategyDisplay(IndexStrategy indexStrategy,
}
}
#endif /* defined(ISTRATDEBUG) */
#endif /* defined(ISTRATDEBUG) */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.18 1998/09/01 03:21:12 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.19 1998/09/01 04:26:59 momjian Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
@@ -87,10 +87,11 @@ btoidcmp(Oid a, Oid b)
int32
btoid8cmp(Oid *a, Oid *b)
{
int i;
for (i=0; i < 8; i++)
int i;
for (i = 0; i < 8; i++)
/* we use this because we need the int4gt, etc */
if (!int4eq(a[i], b[i]))
if (!int4eq(a[i], b[i]))
if (int4gt(a[i], b[i]))
return 1;
else

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.29 1998/09/01 03:21:13 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.30 1998/09/01 04:27:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -54,7 +54,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
int natts = rel->rd_rel->relnatts;
InsertIndexResult res;
Buffer buffer;
itup = &(btitem->bti_itup);
/* we need a scan key to do our search, so build one */

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.31 1998/09/01 03:21:16 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.32 1998/09/01 04:27:03 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
@@ -44,7 +44,7 @@ bool BuildingBtree = false; /* see comment in btbuild() */
bool FastBuild = true; /* use sort/build instead of insertion
* build */
static void _bt_restscan(IndexScanDesc scan);
static void _bt_restscan(IndexScanDesc scan);
/*
* btbuild() -- build a new btree index.
@@ -151,7 +151,7 @@ btbuild(Relation heap,
*/
usefast = false;
}
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
/* start a heap scan */
/* build the index */
@@ -184,7 +184,7 @@ btbuild(Relation heap,
nitups++;
continue;
}
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
/*
@@ -198,7 +198,7 @@ btbuild(Relation heap,
slot->val = htup;
if (ExecQual((List *) pred, econtext) == false)
continue;
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
nitups++;
@@ -283,7 +283,7 @@ btbuild(Relation heap,
#ifndef OMIT_PARTIAL_INDEX
ExecDestroyTupleTable(tupleTable, true);
pfree(econtext);
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
/*
@@ -361,14 +361,13 @@ btinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation
/*
* See comments in btbuild.
*
* if (itup->t_info & INDEX_NULL_MASK)
return (InsertIndexResult) NULL;
* if (itup->t_info & INDEX_NULL_MASK) return (InsertIndexResult) NULL;
*/
btitem = _bt_formitem(itup);
res = _bt_doinsert(rel, btitem,
IndexIsUnique(RelationGetRelid(rel)), heapRel);
IndexIsUnique(RelationGetRelid(rel)), heapRel);
pfree(btitem);
pfree(itup);
@@ -397,27 +396,26 @@ btgettuple(IndexScanDesc scan, ScanDirection dir)
if (ItemPointerIsValid(&(scan->currentItemData)))
{
/*
* Now we don't adjust scans on insertion (comments in
* nbtscan.c:_bt_scandel()) and I hope that we will unlock
* current index page before leaving index in LLL: this
* means that current index tuple could be moved right
* before we get here and we have to restore our scan
* position. We save heap TID pointed by current index
* tuple and use it. This will work untill we start
* to re-use (move heap tuples) without vacuum...
* - vadim 07/29/98
* nbtscan.c:_bt_scandel()) and I hope that we will unlock current
* index page before leaving index in LLL: this means that current
* index tuple could be moved right before we get here and we have
* to restore our scan position. We save heap TID pointed by
* current index tuple and use it. This will work untill we start
* to re-use (move heap tuples) without vacuum... - vadim 07/29/98
*/
_bt_restscan(scan);
res = _bt_next(scan, dir);
}
else
res = _bt_first(scan, dir);
/* Save heap TID to use it in _bt_restscan */
if (res)
((BTScanOpaque)scan->opaque)->curHeapIptr = res->heap_iptr;
((BTScanOpaque) scan->opaque)->curHeapIptr = res->heap_iptr;
return (char *) res;
}
@@ -627,33 +625,34 @@ btdelete(Relation rel, ItemPointer tid)
static void
_bt_restscan(IndexScanDesc scan)
{
Relation rel = scan->relation;
BTScanOpaque so = (BTScanOpaque) scan->opaque;
Buffer buf = so->btso_curbuf;
Page page = BufferGetPage(buf);
ItemPointer current = &(scan->currentItemData);
OffsetNumber offnum = ItemPointerGetOffsetNumber(current),
maxoff = PageGetMaxOffsetNumber(page);
BTPageOpaque opaque = (BTPageOpaque) PageGetSpecialPointer(page);
ItemPointerData target = so->curHeapIptr;
BTItem item;
BlockNumber blkno;
Relation rel = scan->relation;
BTScanOpaque so = (BTScanOpaque) scan->opaque;
Buffer buf = so->btso_curbuf;
Page page = BufferGetPage(buf);
ItemPointer current = &(scan->currentItemData);
OffsetNumber offnum = ItemPointerGetOffsetNumber(current),
maxoff = PageGetMaxOffsetNumber(page);
BTPageOpaque opaque = (BTPageOpaque) PageGetSpecialPointer(page);
ItemPointerData target = so->curHeapIptr;
BTItem item;
BlockNumber blkno;
if (maxoff >= offnum)
{
/*
* if the item is where we left it or has just moved right
* on this page, we're done
/*
* if the item is where we left it or has just moved right on this
* page, we're done
*/
for ( ;
for (;
offnum <= maxoff;
offnum = OffsetNumberNext(offnum))
{
item = (BTItem) PageGetItem(page, PageGetItemId(page, offnum));
if (item->bti_itup.t_tid.ip_blkid.bi_hi == \
target.ip_blkid.bi_hi && \
target.ip_blkid.bi_hi && \
item->bti_itup.t_tid.ip_blkid.bi_lo == \
target.ip_blkid.bi_lo && \
target.ip_blkid.bi_lo && \
item->bti_itup.t_tid.ip_posid == target.ip_posid)
{
current->ip_posid = offnum;
@@ -662,8 +661,8 @@ _bt_restscan(IndexScanDesc scan)
}
}
/*
* By here, the item we're looking for moved right at least one page
/*
* By here, the item we're looking for moved right at least one page
*/
for (;;)
{
@@ -678,15 +677,15 @@ _bt_restscan(IndexScanDesc scan)
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
/* see if it's on this page */
for (offnum = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY ;
for (offnum = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
offnum <= maxoff;
offnum = OffsetNumberNext(offnum))
{
item = (BTItem) PageGetItem(page, PageGetItemId(page, offnum));
if (item->bti_itup.t_tid.ip_blkid.bi_hi == \
target.ip_blkid.bi_hi && \
target.ip_blkid.bi_hi && \
item->bti_itup.t_tid.ip_blkid.bi_lo == \
target.ip_blkid.bi_lo && \
target.ip_blkid.bi_lo && \
item->bti_itup.t_tid.ip_posid == target.ip_posid)
{
ItemPointerSet(current, blkno, offnum);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.17 1998/09/01 03:21:17 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.18 1998/09/01 04:27:04 momjian Exp $
*
*
* NOTES
@@ -166,10 +166,10 @@ _bt_scandel(IndexScanDesc scan, int op, BlockNumber blkno, OffsetNumber offno)
so->btso_curbuf = buf;
if (ItemPointerIsValid(current))
{
Page page = BufferGetPage(buf);
BTItem btitem = (BTItem) PageGetItem(page,
PageGetItemId(page, ItemPointerGetOffsetNumber(current)));
Page page = BufferGetPage(buf);
BTItem btitem = (BTItem) PageGetItem(page,
PageGetItemId(page, ItemPointerGetOffsetNumber(current)));
so->curHeapIptr = btitem->bti_itup.t_tid;
}
}
@@ -209,10 +209,10 @@ _bt_scandel(IndexScanDesc scan, int op, BlockNumber blkno, OffsetNumber offno)
scan->currentItemData = tmp;
if (ItemPointerIsValid(current))
{
Page page = BufferGetPage(buf);
BTItem btitem = (BTItem) PageGetItem(page,
PageGetItemId(page, ItemPointerGetOffsetNumber(current)));
Page page = BufferGetPage(buf);
BTItem btitem = (BTItem) PageGetItem(page,
PageGetItemId(page, ItemPointerGetOffsetNumber(current)));
so->mrkHeapIptr = btitem->bti_itup.t_tid;
}
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.37 1998/09/01 03:21:18 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.38 1998/09/01 04:27:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,14 +28,11 @@
#endif
static BTStack
_bt_searchr(Relation rel, int keysz, ScanKey scankey,
static BTStack _bt_searchr(Relation rel, int keysz, ScanKey scankey,
Buffer *bufP, BTStack stack_in);
static OffsetNumber
_bt_firsteq(Relation rel, TupleDesc itupdesc, Page page,
static OffsetNumber _bt_firsteq(Relation rel, TupleDesc itupdesc, Page page,
Size keysz, ScanKey scankey, OffsetNumber offnum);
static int
_bt_compare(Relation rel, TupleDesc itupdesc, Page page,
static int _bt_compare(Relation rel, TupleDesc itupdesc, Page page,
int keysz, ScanKey scankey, OffsetNumber offnum);
static bool
_bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir);
@@ -219,8 +216,8 @@ _bt_moveright(Relation rel,
if (_bt_skeycmp(rel, keysz, scankey, page,
PageGetItemId(page, P_FIRSTKEY),
BTEqualStrategyNumber))
elog(FATAL, "btree: BTP_CHAIN flag was expected in %s (access = %s)",
rel->rd_rel->relname, access ? "bt_write" : "bt_read");
elog(FATAL, "btree: BTP_CHAIN flag was expected in %s (access = %s)",
rel->rd_rel->relname, access ? "bt_write" : "bt_read");
if (_bt_skeycmp(rel, keysz, scankey, page,
PageGetItemId(page, offmax),
BTEqualStrategyNumber))

View File

@@ -5,7 +5,7 @@
*
*
* IDENTIFICATION
* $Id: nbtsort.c,v 1.32 1998/09/01 03:21:19 momjian Exp $
* $Id: nbtsort.c,v 1.33 1998/09/01 04:27:07 momjian Exp $
*
* NOTES
*
@@ -184,7 +184,7 @@ _bt_isortcmp(BTSortKey *k1, BTSortKey *k2)
return 1; /* 1 > 2 */
}
else if (k2->btsk_item == (BTItem) NULL)
return -1; /* 1 < 2 */
return -1; /* 1 < 2 */
for (i = 0; i < _bt_nattr; i++)
{
@@ -198,14 +198,14 @@ _bt_isortcmp(BTSortKey *k1, BTSortKey *k2)
return 1; /* NULL ">" NOT_NULL */
}
else if (k2_nulls[i] != ' ') /* k2 attr is NULL */
return -1; /* NOT_NULL "<" NULL */
return -1; /* NOT_NULL "<" NULL */
if (_bt_invokestrat(_bt_sortrel, i + 1, BTGreaterStrategyNumber,
k1_datum[i], k2_datum[i]))
return 1; /* 1 > 2 */
else if (_bt_invokestrat(_bt_sortrel, i + 1, BTGreaterStrategyNumber,
k2_datum[i], k1_datum[i]))
return -1; /* 1 < 2 */
return -1; /* 1 < 2 */
}
if (_bt_inspool->isunique && !equal_isnull)
@@ -731,7 +731,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
printf("_bt_spool: inserted <%x> into output tape %d\n",
d, btspool->bts_tape);
}
#endif /* FASTBUILD_DEBUG && FASTBUILD_SPOOL */
#endif /* FASTBUILD_DEBUG && FASTBUILD_SPOOL */
}
/*
@@ -975,7 +975,7 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags)
printf("_bt_buildadd: moved <%x> to offset %d at level %d\n",
d, n, state->btps_level);
}
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
#endif
}
@@ -1058,7 +1058,7 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags)
printf("_bt_buildadd: inserted <%x> at offset %d at level %d\n",
d, off, state->btps_level);
}
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
#endif
if (last_bti == (BTItem) NULL)
first_off = P_FIRSTKEY;
@@ -1254,7 +1254,7 @@ _bt_merge(Relation index, BTSpool *btspool)
npass, nruns, d, t,
BufferGetBlockNumber(state->btps_buf));
}
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
}
else
{
@@ -1283,7 +1283,7 @@ _bt_merge(Relation index, BTSpool *btspool)
npass, nruns, d, t,
btspool->bts_tape);
}
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
}
if (btsk.btsk_datum != (Datum *) NULL)
@@ -1408,7 +1408,7 @@ _bt_upperbuild(Relation index)
printf("_bt_upperbuild: inserting <%x> at %d\n",
d, state->btps_level);
}
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
_bt_buildadd(index, state, nbti, 0);
pfree((void *) nbti);
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.11 1998/09/01 03:21:24 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.12 1998/09/01 04:27:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,8 +27,7 @@
#endif
static OffsetNumber
findnext(IndexScanDesc s, Page p, OffsetNumber n,
static OffsetNumber findnext(IndexScanDesc s, Page p, OffsetNumber n,
ScanDirection dir);
static RetrieveIndexResult rtscancache(IndexScanDesc s, ScanDirection dir);
static RetrieveIndexResult rtfirst(IndexScanDesc s, ScanDirection dir);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.27 1998/09/01 03:21:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.28 1998/09/01 04:27:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -50,25 +50,19 @@ typedef struct RTSTATE
} RTSTATE;
/* non-export function prototypes */
static InsertIndexResult
rtdoinsert(Relation r, IndexTuple itup,
static InsertIndexResult rtdoinsert(Relation r, IndexTuple itup,
RTSTATE *rtstate);
static void
rttighten(Relation r, RTSTACK *stk, char *datum, int att_size,
static void rttighten(Relation r, RTSTACK *stk, char *datum, int att_size,
RTSTATE *rtstate);
static InsertIndexResult
dosplit(Relation r, Buffer buffer, RTSTACK *stack,
static InsertIndexResult dosplit(Relation r, Buffer buffer, RTSTACK *stack,
IndexTuple itup, RTSTATE *rtstate);
static void
rtintinsert(Relation r, RTSTACK *stk, IndexTuple ltup,
static void rtintinsert(Relation r, RTSTACK *stk, IndexTuple ltup,
IndexTuple rtup, RTSTATE *rtstate);
static void rtnewroot(Relation r, IndexTuple lt, IndexTuple rt);
static void
picksplit(Relation r, Page page, SPLITVEC *v, IndexTuple itup,
static void picksplit(Relation r, Page page, SPLITVEC *v, IndexTuple itup,
RTSTATE *rtstate);
static void RTInitBuffer(Buffer b, uint32 f);
static OffsetNumber
choose(Relation r, Page p, IndexTuple it,
static OffsetNumber choose(Relation r, Page p, IndexTuple it,
RTSTATE *rtstate);
static int nospace(Page p, IndexTuple it);
static void initRtstate(RTSTATE *rtstate, Relation index);
@@ -163,12 +157,12 @@ rtbuild(Relation heap,
tupleTable = NULL;
slot = NULL;
}
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
/* count the tuples as we insert them */
nh = ni = 0;
scan = heap_beginscan(heap, 0, SnapshotNow, 0, (ScanKey) NULL);
scan = heap_beginscan(heap, 0, SnapshotNow, 0, (ScanKey) NULL);
while (HeapTupleIsValid(htup = heap_getnext(scan, 0)))
{
@@ -188,7 +182,7 @@ rtbuild(Relation heap,
ni++;
continue;
}
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
/*
@@ -202,7 +196,7 @@ rtbuild(Relation heap,
slot->val = htup;
if (ExecQual((List *) pred, econtext) == false)
continue;
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
ni++;
@@ -263,7 +257,7 @@ rtbuild(Relation heap,
#ifndef OMIT_PARTIAL_INDEX
ExecDestroyTupleTable(tupleTable, true);
pfree(econtext);
#endif /* OMIT_PARTIAL_INDEX */
#endif /* OMIT_PARTIAL_INDEX */
}
/*
@@ -1042,4 +1036,4 @@ _rtdump(Relation r)
}
}
#endif /* defined RTDEBUG */
#endif /* defined RTDEBUG */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.18 1998/09/01 03:21:28 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.19 1998/09/01 04:27:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,14 +30,11 @@
/* routines defined and used here */
static void rtregscan(IndexScanDesc s);
static void rtdropscan(IndexScanDesc s);
static void
rtadjone(IndexScanDesc s, int op, BlockNumber blkno,
static void rtadjone(IndexScanDesc s, int op, BlockNumber blkno,
OffsetNumber offnum);
static void
adjuststack(RTSTACK *stk, BlockNumber blkno,
static void adjuststack(RTSTACK *stk, BlockNumber blkno,
OffsetNumber offnum);
static void
adjustiptr(IndexScanDesc s, ItemPointer iptr,
static void adjustiptr(IndexScanDesc s, ItemPointer iptr,
int op, BlockNumber blkno, OffsetNumber offnum);
/*

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtstrat.c,v 1.9 1998/09/01 03:21:30 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtstrat.c,v 1.10 1998/09/01 04:27:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,8 +18,7 @@
#include <access/rtree.h>
#include <access/istrat.h>
static StrategyNumber
RelationGetRTStrategy(Relation r,
static StrategyNumber RelationGetRTStrategy(Relation r,
AttrNumber attnum, RegProcedure proc);
/*

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.18 1998/09/01 03:21:31 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.19 1998/09/01 04:27:15 momjian Exp $
*
* NOTES
* This file contains the high level access-method interface to the
@@ -29,8 +29,7 @@
static int RecoveryCheckingEnabled(void);
static void TransRecover(Relation logRelation);
static bool TransactionLogTest(TransactionId transactionId, XidStatus status);
static void
TransactionLogUpdate(TransactionId transactionId,
static void TransactionLogUpdate(TransactionId transactionId,
XidStatus status);
/* ----------------

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.16 1998/01/07 21:02:19 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.17 1998/09/01 04:27:16 momjian Exp $
*
* NOTES
* This file contains support functions for the high
@@ -23,11 +23,9 @@
#include <access/xact.h>
#include <storage/lmgr.h>
static XidStatus
TransBlockGetXidStatus(Block tblock,
static XidStatus TransBlockGetXidStatus(Block tblock,
TransactionId transactionId);
static void
TransBlockSetXidStatus(Block tblock,
static void TransBlockSetXidStatus(Block tblock,
TransactionId transactionId, XidStatus xstatus);
/* ----------------------------------------------------------------

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.16 1998/07/21 06:17:13 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.17 1998/09/01 04:27:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,7 +31,7 @@ static void VariableRelationPutNextOid(Oid *oidP);
*/
int OidGenLockId;
VariableCache ShmemVariableCache = NULL;
VariableCache ShmemVariableCache = NULL;
/* ----------------------------------------------------------------
* variable relation query/update routines
@@ -292,11 +292,11 @@ GetNewTransactionId(TransactionId *xid)
}
SpinAcquire(OidGenLockId); /* not good for concurrency... */
if (ShmemVariableCache->xid_count == 0)
{
TransactionId nextid;
VariableRelationGetNextXid(&nextid);
TransactionIdStore(nextid, &(ShmemVariableCache->nextXid));
ShmemVariableCache->xid_count = VAR_XID_PREFETCH;
@@ -307,7 +307,7 @@ GetNewTransactionId(TransactionId *xid)
TransactionIdStore(ShmemVariableCache->nextXid, xid);
TransactionIdAdd(&(ShmemVariableCache->nextXid), 1);
(ShmemVariableCache->xid_count)--;
SpinRelease(OidGenLockId);
}

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.22 1998/09/01 03:21:33 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.23 1998/09/01 04:27:19 momjian Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
@@ -898,7 +898,7 @@ CommitTransaction()
* ----------------
*/
/* handle commit for large objects [ PA, 7/17/98 ] */
/* handle commit for large objects [ PA, 7/17/98 ] */
_lo_commit();
CloseSequences();