1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +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
/* ----------------

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);

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.

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
@ -139,8 +139,8 @@ hashoid8(Oid *key)
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
@ -283,7 +283,7 @@ heapgettup(Relation relation,
/* assume it is a valid TID XXX */
if (ItemPointerIsValid(tid) == false)
{
*buf= InvalidBuffer;
*buf = InvalidBuffer;
return NULL;
}
*buf = RelationGetBufferWithBuffer(relation,
@ -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
@ -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;
}
@ -1206,9 +1208,10 @@ 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);

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
@ -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
@ -456,9 +453,7 @@ RelationInvokeStrategy(Relation relation,
}
if (index == (*termP)->degree)
{
return StrategyTermEvaluate(*termP, strategyMap, left, right);
}
termP += 1;
}

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
@ -88,7 +88,8 @@ int32
btoid8cmp(Oid *a, Oid *b)
{
int i;
for (i=0; i < 8; i++)
for (i = 0; i < 8; i++)
/* we use this because we need the int4gt, etc */
if (!int4eq(a[i], b[i]))
if (int4gt(a[i], b[i]))

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 $
*
*-------------------------------------------------------------------------
*/

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.
@ -361,8 +361,7 @@ 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);
@ -397,16 +396,15 @@ 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);
@ -416,7 +414,7 @@ btgettuple(IndexScanDesc scan, ScanDirection 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;
}
@ -641,11 +639,12 @@ _bt_restscan(IndexScanDesc scan)
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))
{
@ -678,7 +677,7 @@ _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))
{

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

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);

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
*

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);

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 $
*
*-------------------------------------------------------------------------
*/

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:

View File

@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.50 1998/09/01 03:21:36 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.51 1998/09/01 04:27:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -325,7 +325,8 @@ BootstrapMain(int argc, char *argv[])
DataDir = optarg;
break;
case 'd':
DebugMode = true; /* print out debugging info while parsing */
DebugMode = true; /* print out debugging info while
* parsing */
break;
case 'C':
Noversion = true;
@ -601,7 +602,7 @@ DefineAttr(char *name, char *type, int attnum)
printf("<%s %s> ", attrtypes[attnum]->attname.data, type);
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Procid[typeoid].len;
attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) ||(attlen == 4);
attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) || (attlen == 4);
attrtypes[attnum]->attalign = 'i';
}
attrtypes[attnum]->attcacheoff = -1;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.15 1998/09/01 03:21:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.16 1998/09/01 04:27:27 momjian Exp $
*
* NOTES
* See acl.h.
@ -453,7 +453,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
Anum_pg_class_relowner,
RelationGetDescr(relation),
(bool *) NULL);
acl = aclownerdefault(relname, (AclId)ownerId);
acl = aclownerdefault(relname, (AclId) ownerId);
}
#else
{ /* This is why the syscache is great... */

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.17 1998/09/01 03:21:40 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.18 1998/09/01 04:27:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.63 1998/09/01 03:21:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.64 1998/09/01 04:27:29 momjian Exp $
*
* INTERFACE ROUTINES
* heap_create() - Create an uncataloged heap relation
@ -65,8 +65,7 @@
#include <string.h>
#endif
static void
AddPgRelationTuple(Relation pg_class_desc,
static void AddPgRelationTuple(Relation pg_class_desc,
Relation new_rel_desc, Oid new_rel_oid, unsigned natts,
char relkind);
static void AddToTempRelList(Relation r);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.59 1998/09/01 03:21:43 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.60 1998/09/01 04:27:31 momjian Exp $
*
*
* INTERFACE ROUTINES
@ -65,29 +65,25 @@
/* non-export function prototypes */
static Oid
RelationNameGetObjectId(char *relationName, Relation pg_class);
RelationNameGetObjectId(char *relationName, Relation pg_class);
static Oid GetHeapRelationOid(char *heapRelationName, char *indexRelationName);
static TupleDesc BuildFuncTupleDesc(FuncIndexInfo *funcInfo);
static TupleDesc
ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
static TupleDesc ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
List *attributeList,
int numatts, AttrNumber *attNums);
static void ConstructIndexReldesc(Relation indexRelation, Oid amoid);
static Oid UpdateRelationRelation(Relation indexRelation);
static void
InitializeAttributeOids(Relation indexRelation,
static void InitializeAttributeOids(Relation indexRelation,
int numatts,
Oid indexoid);
static void
AppendAttributeTuples(Relation indexRelation, int numatts);
static void
UpdateIndexRelation(Oid indexoid, Oid heapoid,
static void UpdateIndexRelation(Oid indexoid, Oid heapoid,
FuncIndexInfo *funcInfo, int natts,
AttrNumber *attNums, Oid *classOids, Node *predicate,
List *attributeList, bool islossy, bool unique);
static void
DefaultBuild(Relation heapRelation, Relation indexRelation,
static void DefaultBuild(Relation heapRelation, Relation indexRelation,
int numberOfAttributes, AttrNumber *attributeNumber,
IndexStrategy indexStrategy, uint16 parameterCount,
Datum *parameter, FuncIndexInfoPtr funcInfo, PredInfo *predInfo);
@ -614,7 +610,9 @@ static void
AppendAttributeTuples(Relation indexRelation, int numatts)
{
Relation pg_attribute;
HeapTuple init_tuple, cur_tuple = NULL, new_tuple;
HeapTuple init_tuple,
cur_tuple = NULL,
new_tuple;
bool hasind;
Relation idescs[Num_pg_attr_indices];
@ -702,7 +700,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
replace);
pfree(cur_tuple);
heap_insert(pg_attribute,new_tuple);
heap_insert(pg_attribute, new_tuple);
if (hasind)
CatalogIndexInsert(idescs, Num_pg_attr_indices, pg_attribute, new_tuple);
@ -1560,7 +1558,7 @@ DefaultBuild(Relation heapRelation,
*/
scan = heap_beginscan(heapRelation, /* relation */
0, /* start at end */
SnapshotNow,/* seeself */
SnapshotNow, /* seeself */
0, /* number of keys */
(ScanKey) NULL); /* scan key */

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.25 1998/09/01 03:21:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.26 1998/09/01 04:27:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -270,13 +270,13 @@ AttributeNameIndexScan(Relation heapRelation,
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure)F_OIDEQ,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(relid));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure)F_NAMEEQ,
(RegProcedure) F_NAMEEQ,
NameGetDatum(attname));
idesc = index_openr(AttributeNameIndex);
@ -299,13 +299,13 @@ AttributeNumIndexScan(Relation heapRelation,
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure)F_OIDEQ,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(relid));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure)F_INT2EQ,
(RegProcedure) F_INT2EQ,
Int16GetDatum(attnum));
idesc = index_openr(AttributeNumIndex);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.16 1998/09/01 03:21:45 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.17 1998/09/01 04:27:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.28 1998/09/01 03:21:47 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.29 1998/09/01 04:27:36 momjian Exp $
*
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
@ -35,28 +35,23 @@
#include <string.h>
#endif
static Oid
OperatorGetWithOpenRelation(Relation pg_operator_desc,
static Oid OperatorGetWithOpenRelation(Relation pg_operator_desc,
const char *operatorName,
Oid leftObjectId,
Oid rightObjectId);
static Oid
OperatorGet(char *operatorName,
static Oid OperatorGet(char *operatorName,
char *leftTypeName,
char *rightTypeName);
static Oid
OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
static Oid OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
char *operatorName,
Oid leftObjectId,
Oid rightObjectId);
static Oid
OperatorShellMake(char *operatorName,
static Oid OperatorShellMake(char *operatorName,
char *leftTypeName,
char *rightTypeName);
static void
OperatorDef(char *operatorName,
static void OperatorDef(char *operatorName,
int definedOK,
char *leftTypeName,
char *rightTypeName,

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.22 1998/09/01 03:21:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.23 1998/09/01 04:27:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -129,6 +129,7 @@ ProcedureCreate(char *procedureName,
if (!strcmp(languageName, "sql"))
{
/*
* If this call is defining a set, check if the set is already
* defined by looking to see whether this call's function text

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.29 1998/09/01 03:21:49 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.30 1998/09/01 04:27:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -33,8 +33,7 @@
#include <string.h>
#endif
static Oid
TypeShellMakeWithOpenRelation(Relation pg_type_desc,
static Oid TypeShellMakeWithOpenRelation(Relation pg_type_desc,
char *typeName);
/* ----------------------------------------------------------------
@ -379,17 +378,17 @@ TypeCreate(char *typeName,
* ----------------
*/
i = 0;
namestrcpy(&name,typeName);
namestrcpy(&name, typeName);
values[i++] = NameGetDatum(&name); /* 1 */
values[i++] = (Datum) GetUserId(); /* 2 */
values[i++] = (Datum) internalSize; /* 3 */
values[i++] = (Datum) externalSize; /* 4 */
values[i++] = (Datum) passedByValue;/* 5 */
values[i++] = (Datum) passedByValue; /* 5 */
values[i++] = (Datum) typeType; /* 6 */
values[i++] = (Datum) (bool) 1; /* 7 */
values[i++] = (Datum) typDelim; /* 8 */
values[i++] = (Datum) (typeType == 'c' ? relationOid : InvalidOid); /* 9 */
values[i++] = (Datum) elementObjectId;/* 10 */
values[i++] = (Datum) elementObjectId; /* 10 */
/*
* arguments to type input and output functions must be 0
@ -534,7 +533,8 @@ TypeRename(char *oldTypeName, char *newTypeName)
{
Relation pg_type_desc;
Relation idescs[Num_pg_type_indices];
HeapTuple oldtup, newtup;
HeapTuple oldtup,
newtup;
pg_type_desc = heap_openr(TypeRelationName);

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.14 1998/08/19 02:01:58 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.15 1998/09/01 04:28:09 momjian Exp $
*
* NOTES
* At the point the version is defined, 2 physical relations are created

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.39 1998/09/01 03:21:50 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.40 1998/09/01 04:27:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -213,13 +213,12 @@ Async_Notify(char *relname)
heap_endscan(sRel);
/*
* Note: if the write lock is unset we can get multiple tuples
* with same oid if other backends notify the same relation.
* Use this option at your own risk.
* Note: if the write lock is unset we can get multiple tuples with
* same oid if other backends notify the same relation. Use this
* option at your own risk.
*/
if (NotifyUnlock) {
if (NotifyUnlock)
RelationUnsetLockForWrite(lRel);
}
heap_close(lRel);
@ -318,12 +317,13 @@ Async_NotifyAtCommit()
heap_close(lRel);
/*
* Notify the frontend inside the current transaction while
* we still have a valid write lock on pg_listeners. This
* avoid waiting until all other backends have finished
* with pg_listener.
* Notify the frontend inside the current transaction while we
* still have a valid write lock on pg_listeners. This avoid
* waiting until all other backends have finished with
* pg_listener.
*/
if (notifyFrontEndPending) {
if (notifyFrontEndPending)
{
/* The aux version is called inside transaction */
Async_NotifyFrontEnd_Aux();
}
@ -333,15 +333,15 @@ Async_NotifyAtCommit()
}
else
{
/*
* No notifies issued by us. If notifyFrontEndPending has been set
* by Async_NotifyHandler notify the frontend of pending notifies
* from other backends.
* No notifies issued by us. If notifyFrontEndPending has been
* set by Async_NotifyHandler notify the frontend of pending
* notifies from other backends.
*/
if (notifyFrontEndPending) {
if (notifyFrontEndPending)
Async_NotifyFrontEnd();
}
}
ClearPendingNotify();
}
@ -368,7 +368,8 @@ Async_NotifyAtCommit()
void
Async_NotifyAtAbort()
{
if (pendingNotifies) {
if (pendingNotifies)
{
ClearPendingNotify();
DLFreeList(pendingNotifies);
}
@ -380,10 +381,8 @@ Async_NotifyAtAbort()
{
/* don't forget to notify front end */
if (notifyFrontEndPending)
{
Async_NotifyFrontEnd();
}
}
}
/*
@ -423,7 +422,8 @@ Async_Listen(char *relname, int pid)
char *relnamei;
TupleDesc tupDesc;
if (whereToSendOutput != Remote) {
if (whereToSendOutput != Remote)
{
elog(NOTICE, "Async_Listen: "
"listen not available on interactive sessions");
return;
@ -459,7 +459,8 @@ Async_Listen(char *relname, int pid)
if (pid == MyProcPid)
alreadyListener = 1;
}
if (alreadyListener) {
if (alreadyListener)
{
/* No need to scan the rest of the table */
break;
}
@ -521,7 +522,8 @@ Async_Unlisten(char *relname, int pid)
HeapTuple lTuple;
/* Handle specially the `unlisten "*"' command */
if ((!relname) || (*relname == '\0') || (strcmp(relname,"*")==0)) {
if ((!relname) || (*relname == '\0') || (strcmp(relname, "*") == 0))
{
Async_UnlistenAll();
return;
}
@ -575,9 +577,7 @@ Async_UnlistenAll()
sRel = heap_beginscan(lRel, 0, SnapshotNow, 1, key);
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0)))
{
heap_delete(lRel, &lTuple->t_ctid);
}
heap_endscan(sRel);
RelationUnsetLockForWrite(lRel);
heap_close(lRel);
@ -687,13 +687,16 @@ Async_NotifyFrontEnd_Aux()
&isnull);
/*
* This hack deletes duplicate tuples which can be left
* in the table if the NotifyUnlock option is set.
* I'm further investigating this. -- dz
* This hack deletes duplicate tuples which can be left in the
* table if the NotifyUnlock option is set. I'm further
* investigating this. -- dz
*/
if (NotifyHack) {
for (i=0; i<ndone; i++) {
if (strcmp(DatumGetName(d)->data, done[i]) == 0) {
if (NotifyHack)
{
for (i = 0; i < ndone; i++)
{
if (strcmp(DatumGetName(d)->data, done[i]) == 0)
{
TPRINTF(TRACE_NOTIFY,
"Async_NotifyFrontEnd: duplicate %s",
DatumGetName(d)->data);
@ -701,10 +704,9 @@ Async_NotifyFrontEnd_Aux()
continue;
}
}
if (ndone < MAX_DONE) {
if (ndone < MAX_DONE)
done[ndone++] = pstrdup(DatumGetName(d)->data);
}
}
rTuple = heap_modifytuple(lTuple, lRel, value, nulls, repl);
heap_replace(lRel, &lTuple->t_ctid, rTuple);

View File

@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.30 1998/09/01 03:21:52 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.31 1998/09/01 04:27:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -128,7 +128,8 @@ cluster(char *oldrelname, char *oldindexname)
elog(ERROR, "cluster: unknown relation: \"%s\"",
oldrelname);
}
OIDOldHeap = RelationGetRelid(OldHeap);/* Get OID for the index scan */
OIDOldHeap = RelationGetRelid(OldHeap); /* Get OID for the index
* scan */
OldIndex = index_openr(oldindexname); /* Open old index relation */
if (!RelationIsValid(OldIndex))

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.31 1998/09/01 03:21:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.32 1998/09/01 04:27:46 momjian Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.58 1998/09/01 03:21:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.59 1998/09/01 04:27:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -52,8 +52,7 @@ static Oid GetOutputFunction(Oid type);
static Oid GetTypeElement(Oid type);
static Oid GetInputFunction(Oid type);
static Oid IsTypeByVal(Oid type);
static void
GetIndexRelations(Oid main_relation_oid,
static void GetIndexRelations(Oid main_relation_oid,
int *n_indices,
Relation **index_rels);
@ -116,9 +115,9 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
int result;
/*
* Close previous file opened for COPY but failed with elog().
* There should be a better way, but would not be modular.
* Prevents file descriptor leak. bjm 1998/08/29
* Close previous file opened for COPY but failed with elog(). There
* should be a better way, but would not be modular. Prevents file
* descriptor leak. bjm 1998/08/29
*/
if (file_opened)
FreeFile(fp);
@ -1022,11 +1021,13 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
char c;
int done = 0;
int i = 0;
#ifdef MULTIBYTE
int mblen;
int encoding;
unsigned char s[2];
int j;
#endif
#ifdef MULTIBYTE
@ -1139,7 +1140,8 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
s[0] = c;
mblen = pg_encoding_mblen(encoding, s);
mblen--;
for(j=0;j<mblen;j++) {
for (j = 0; j < mblen; j++)
{
c = getc(fp);
if (feof(fp))
return NULL;
@ -1151,7 +1153,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
}
attribute[i] = '\0';
#ifdef MULTIBYTE
return(pg_client_to_server((unsigned char*)attribute, strlen(attribute)));
return (pg_client_to_server((unsigned char *) attribute, strlen(attribute)));
#else
return &attribute[0];
#endif
@ -1167,6 +1169,7 @@ CopyAttributeOut(FILE *fp, char *server_string, char *delim, int is_array)
int mblen;
int encoding;
int i;
#endif
#ifdef MULTIBYTE
@ -1204,9 +1207,8 @@ CopyAttributeOut(FILE *fp, char *server_string, char *delim, int is_array)
}
}
#ifdef MULTIBYTE
for (i=0;i<mblen;i++) {
fputc(*(string+i), fp);
}
for (i = 0; i < mblen; i++)
fputc(*(string + i), fp);
#else
fputc(*string, fp);
#endif

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.33 1998/09/01 03:21:56 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.34 1998/09/01 04:27:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -33,8 +33,7 @@
* ----------------
*/
static int
checkAttrExists(char *attributeName,
static int checkAttrExists(char *attributeName,
char *attributeType, List *schema);
static List *MergeAttributes(List *schema, List *supers, List **supconstr);
static void StoreCatalogInheritance(Oid relationId, List *supers);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.23 1998/09/01 03:21:57 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.24 1998/09/01 04:27:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -36,8 +36,7 @@
/* non-export function prototypes */
static void
check_permissions(char *command, char *dbpath, char *dbname,
static void check_permissions(char *command, char *dbpath, char *dbname,
Oid *dbIdP, int4 *userIdP);
static HeapTuple get_pg_dbtup(char *command, char *dbname, Relation dbrel);
static void stop_vacuum(char *dbpath, char *dbname);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.25 1998/09/01 03:21:58 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.26 1998/09/01 04:27:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -41,16 +41,13 @@
/* non-export function prototypes */
static void CheckPredicate(List *predList, List *rangeTable, Oid baseRelOid);
static void
CheckPredExpr(Node *predicate, List *rangeTable,
static void CheckPredExpr(Node *predicate, List *rangeTable,
Oid baseRelOid);
static void
CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid);
static void
FuncIndexArgs(IndexElem *funcIndex, AttrNumber *attNumP,
static void FuncIndexArgs(IndexElem *funcIndex, AttrNumber *attNumP,
Oid *argTypes, Oid *opOidP, Oid relId);
static void
NormIndexAttrs(List *attList, AttrNumber *attNumP,
static void NormIndexAttrs(List *attList, AttrNumber *attNumP,
Oid *opOidP, Oid relId);
static char *GetDefaultOpClass(Oid atttypid);
@ -468,7 +465,8 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
Oid relId)
{
List *rest;
HeapTuple atttuple, tuple;
HeapTuple atttuple,
tuple;
/*
* process attributeList

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.23 1998/08/04 16:43:54 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.24 1998/09/01 04:27:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -280,11 +280,11 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
List *saved_rtable = es->rtable;
List *lst;
int whichplan = 0;
Append *appendplan = (Append *)plan;
Append *appendplan = (Append *) plan;
foreach(lst, appendplan->appendplans)
{
Plan *subnode = (Plan *)lfirst(lst);
Plan *subnode = (Plan *) lfirst(lst);
if (appendplan->inheritrelid > 0)
{

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.23 1998/09/01 03:22:01 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.24 1998/09/01 04:27:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -64,39 +64,31 @@ typedef struct _teeInfo
QueryTreeList *appendQlist(QueryTreeList *q1, QueryTreeList *q2);
void OffsetVarAttno(Node *node, int varno, int offset);
static void
appendTeeQuery(TeeInfo * teeInfo,
static void appendTeeQuery(TeeInfo * teeInfo,
QueryTreeList *q,
char *teeNodeName);
static Plan *
replaceTeeScans(Plan *plan,
static Plan *replaceTeeScans(Plan *plan,
Query *parsetree,
TeeInfo * teeInfo);
static void
replaceSeqScan(Plan *plan,
static void replaceSeqScan(Plan *plan,
Plan *parent,
int rt_ind,
Plan *tplan);
static void
tg_rewriteQuery(TgRecipe * r, TgNode * n,
static void tg_rewriteQuery(TgRecipe * r, TgNode * n,
QueryTreeList *q,
QueryTreeList *inputQlist);
static Node *
tg_replaceNumberedParam(Node *expression,
static Node *tg_replaceNumberedParam(Node *expression,
int pnum,
int rt_ind,
char *teeRelName);
static Node *
tg_rewriteParamsInExpr(Node *expression,
static Node *tg_rewriteParamsInExpr(Node *expression,
QueryTreeList *inputQlist);
static QueryTreeList *
tg_parseSubQuery(TgRecipe * r,
static QueryTreeList *tg_parseSubQuery(TgRecipe * r,
TgNode * n,
TeeInfo * teeInfo);
static QueryTreeList *
tg_parseTeeNode(TgRecipe * r,
static QueryTreeList *tg_parseTeeNode(TgRecipe * r,
TgNode * n,
int i,
QueryTreeList *qList,

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.28 1998/09/01 03:22:02 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.29 1998/09/01 04:27:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -354,7 +354,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
if ((((Form_pg_proc) GETSTRUCT(tup))->prolang) == INTERNALlanguageId)
{
heap_close(relation);
elog(ERROR, "RemoveFunction: function \"%s\" is built-in",functionName);
elog(ERROR, "RemoveFunction: function \"%s\" is built-in", functionName);
}
heap_delete(relation, &tup->t_ctid);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.16 1998/09/01 03:22:04 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.17 1998/09/01 04:27:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -111,9 +111,7 @@ renameatt(char *relname,
0, 0, 0);
if (!HeapTupleIsValid(reltup))
{
elog(ERROR, "renameatt: unknown relation: \"%s\"", relname);
}
myrelid = reltup->t_oid;

View File

@ -329,16 +329,19 @@ setval(struct varlena * seqin, int4 next)
#endif
/* open and WIntentLock sequence */
elm = init_sequence ("setval", seqname);
seq = read_info ("setval", elm, &buf); /* lock page and read tuple */
elm = init_sequence("setval", seqname);
seq = read_info("setval", elm, &buf); /* lock page and read
* tuple */
if ( seq->cache_value != 1 ) {
elog (ERROR, "%s.setval: can't set value of sequence %s, cache != 1",
if (seq->cache_value != 1)
{
elog(ERROR, "%s.setval: can't set value of sequence %s, cache != 1",
seqname, seqname);
}
if ((next < seq->min_value) || (next > seq->max_value)) {
elog (ERROR, "%s.setval: value %d is of of bounds (%d,%d)",
if ((next < seq->min_value) || (next > seq->max_value))
{
elog(ERROR, "%s.setval: value %d is of of bounds (%d,%d)",
seqname, next, seq->min_value, seq->max_value);
}
@ -350,11 +353,11 @@ setval(struct varlena * seqin, int4 next)
seq->last_value = next; /* last fetched number */
seq->is_called = 't';
if ( WriteBuffer (buf) == STATUS_ERROR )
elog (ERROR, "%s.settval: WriteBuffer failed", seqname);
if (WriteBuffer(buf) == STATUS_ERROR)
elog(ERROR, "%s.settval: WriteBuffer failed", seqname);
ItemPointerSet(&iptr, 0, FirstOffsetNumber);
RelationUnsetSingleWLockPage (elm->rel, &iptr);
RelationUnsetSingleWLockPage(elm->rel, &iptr);
return next;
}

View File

@ -40,8 +40,7 @@ void RelationBuildTriggers(Relation relation);
void FreeTriggerDesc(Relation relation);
static void DescribeTrigger(TriggerDesc *trigdesc, Trigger *trigger);
static HeapTuple
GetTupleForTrigger(Relation relation, ItemPointer tid,
static HeapTuple GetTupleForTrigger(Relation relation, ItemPointer tid,
bool before);
extern GlobalMemory CacheCxt;

View File

@ -430,8 +430,8 @@ RemoveUser(char *user)
* tables, views, etc owned by the user.
*
* The second option would be to create a means of deleting tables, view,
* etc. owned by the user from other databases. pg_shadow is global and
* so this must be done at some point.
* etc. owned by the user from other databases. pg_shadow is global
* and so this must be done at some point.
*
* Let us not forget that the user should be removed from the pg_groups
* also.

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.79 1998/09/01 03:22:08 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.80 1998/09/01 04:28:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -555,7 +555,8 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
{
if (Irel != (Relation *) NULL)
vc_clsindices(nindices, Irel);
if (vacuum_pages.vpl_num_pages > 0)/* Clean pages from vacuum_pages list */
if (vacuum_pages.vpl_num_pages > 0) /* Clean pages from
* vacuum_pages list */
vc_vacheap(vacrelstats, onerel, &vacuum_pages);
}
@ -875,8 +876,8 @@ vc_scanheap(VRelStats *vacrelstats, Relation onerel,
fraged_pages->vpl_empty_end_pages = empty_end_pages;
/*
* Try to make fraged_pages keeping in mind that we can't use free space of
* "empty" end-pages and last page if it reapped.
* Try to make fraged_pages keeping in mind that we can't use free
* space of "empty" end-pages and last page if it reapped.
*/
if (do_shrinking && vacuum_pages->vpl_num_pages - empty_end_pages > 0)
{
@ -1025,7 +1026,8 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
/* get prev reapped page from vacuum_pages */
last_vacuum_page = vacuum_pages->vpl_pagedesc[vacuumed_pages - 1];
last_vacuum_block = last_vacuum_page->vpd_blkno;
if (blkno == last_fraged_block) /* this page in fraged_pages too */
if (blkno == last_fraged_block) /* this page in
* fraged_pages too */
{
--num_fraged_pages;
Assert(num_fraged_pages > 0);
@ -1201,8 +1203,8 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
}
/*
* Clean uncleaned reapped pages from vacuum_pages list and set xmin committed
* for inserted tuples
* Clean uncleaned reapped pages from vacuum_pages list and set xmin
* committed for inserted tuples
*/
checked_moved = 0;
for (i = 0, vpp = vacuum_pages->vpl_pagedesc; i < vacuumed_pages; i++, vpp++)
@ -1351,7 +1353,8 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList vacuum_pages)
int i;
nblocks = vacuum_pages->vpl_num_pages;
nblocks -= vacuum_pages->vpl_empty_end_pages;/* nothing to do with them */
nblocks -= vacuum_pages->vpl_empty_end_pages; /* nothing to do with
* them */
for (i = 0, vpp = vacuum_pages->vpl_pagedesc; i < nblocks; i++, vpp++)
{
@ -1385,7 +1388,8 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList vacuum_pages)
nblocks = smgrtruncate(DEFAULT_SMGR, onerel, nblocks);
Assert(nblocks >= 0);
vacrelstats->num_pages = nblocks; /* set new number of blocks */
vacrelstats->num_pages = nblocks; /* set new number of
* blocks */
}
} /* vc_vacheap */
@ -2216,7 +2220,11 @@ vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc)
ObjectIdGetDatum(RelationGetRelid(Irel[i])),
0, 0, 0);
Assert(cachetuple);
/* we never free the copy we make, because Idesc needs it for later */
/*
* we never free the copy we make, because Idesc needs it for
* later
*/
idcur->tform = (Form_pg_index) GETSTRUCT(cachetuple);
for (attnumP = &(idcur->tform->indkey[0]), natts = 0;
*attnumP != InvalidAttrNumber && natts != INDEX_MAX_KEYS;
@ -2247,7 +2255,8 @@ vc_enough_space(VPageDescr vpd, Size len)
if (len > vpd->vpd_free)
return false;
if (vpd->vpd_offsets_used < vpd->vpd_offsets_free) /* there are free itemid(s) */
if (vpd->vpd_offsets_used < vpd->vpd_offsets_free) /* there are free
* itemid(s) */
return true; /* and len <= free_space */
/* ok. noff_usd >= noff_free and so we'll have to allocate new itemid */

View File

@ -2,7 +2,7 @@
* Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements.
*
* $Id: variable.c,v 1.11 1998/09/01 03:22:10 momjian Exp $
* $Id: variable.c,v 1.12 1998/09/01 04:28:07 momjian Exp $
*
*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.24 1998/08/06 05:12:30 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.25 1998/09/01 04:28:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.24 1998/07/27 19:37:54 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.25 1998/09/01 04:28:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -54,8 +54,7 @@
#include "access/heapam.h"
#include "catalog/heap.h"
static Pointer
ExecBeginScan(Relation relation, int nkeys, ScanKey skeys,
static Pointer ExecBeginScan(Relation relation, int nkeys, ScanKey skeys,
bool isindex, ScanDirection dir, Snapshot snapshot);
static Relation ExecOpenR(Oid relationOid, bool isindex);

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/execFlatten.c,v 1.6 1998/09/01 03:22:11 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/execFlatten.c,v 1.7 1998/09/01 04:28:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -33,8 +33,7 @@
#include "executor/execFlatten.h"
#ifdef SETS_FIXED
static bool
FjoinBumpOuterNodes(TargetEntry *tlist, ExprContext *econtext,
static bool FjoinBumpOuterNodes(TargetEntry *tlist, ExprContext *econtext,
DatumPtr results, char *nulls);
#endif

View File

@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.54 1998/09/01 03:22:14 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.55 1998/09/01 04:28:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -54,31 +54,25 @@
#include "catalog/heap.h"
#include "commands/trigger.h"
void
ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
void ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
Query *parseTree);
/* decls for local routines only used within this module */
static TupleDesc
InitPlan(CmdType operation, Query *parseTree,
static TupleDesc InitPlan(CmdType operation, Query *parseTree,
Plan *plan, EState *estate);
static void EndPlan(Plan *plan, EState *estate);
static TupleTableSlot *
ExecutePlan(EState *estate, Plan *plan,
static TupleTableSlot *ExecutePlan(EState *estate, Plan *plan,
Query *parseTree, CmdType operation,
int numberTuples, ScanDirection direction,
void (*printfunc) ());
static void ExecRetrieve(TupleTableSlot *slot, void (*printfunc) (),
EState *estate);
static void
ExecAppend(TupleTableSlot *slot, ItemPointer tupleid,
static void ExecAppend(TupleTableSlot *slot, ItemPointer tupleid,
EState *estate);
static void
ExecDelete(TupleTableSlot *slot, ItemPointer tupleid,
static void ExecDelete(TupleTableSlot *slot, ItemPointer tupleid,
EState *estate);
static void
ExecReplace(TupleTableSlot *slot, ItemPointer tupleid,
static void ExecReplace(TupleTableSlot *slot, ItemPointer tupleid,
EState *estate, Query *parseTree);
/* end of local decls */
@ -547,6 +541,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
(operation == CMD_SELECT && junk_filter_needed))
{
JunkFilter *j = (JunkFilter *) ExecInitJunkFilter(targetList);
estate->es_junkFilter = j;
if (operation == CMD_SELECT)

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.35 1998/09/01 03:22:18 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.36 1998/09/01 04:28:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -68,24 +68,19 @@ int execConstLen;
/* static functions decls */
static Datum ExecEvalAggreg(Aggreg *agg, ExprContext *econtext, bool *isNull);
static Datum
ExecEvalArrayRef(ArrayRef *arrayRef, ExprContext *econtext,
static Datum ExecEvalArrayRef(ArrayRef *arrayRef, ExprContext *econtext,
bool *isNull, bool *isDone);
static Datum ExecEvalAnd(Expr *andExpr, ExprContext *econtext, bool *isNull);
static Datum
ExecEvalFunc(Expr *funcClause, ExprContext *econtext,
static Datum ExecEvalFunc(Expr *funcClause, ExprContext *econtext,
bool *isNull, bool *isDone);
static void
ExecEvalFuncArgs(FunctionCachePtr fcache, ExprContext *econtext,
static void ExecEvalFuncArgs(FunctionCachePtr fcache, ExprContext *econtext,
List *argList, Datum argV[], bool *argIsDone);
static Datum ExecEvalNot(Expr *notclause, ExprContext *econtext, bool *isNull);
static Datum
ExecEvalOper(Expr *opClause, ExprContext *econtext,
static Datum ExecEvalOper(Expr *opClause, ExprContext *econtext,
bool *isNull);
static Datum ExecEvalOr(Expr *orExpr, ExprContext *econtext, bool *isNull);
static Datum ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull);
static Datum
ExecMakeFunctionResult(Node *node, List *arguments,
static Datum ExecMakeFunctionResult(Node *node, List *arguments,
ExprContext *econtext, bool *isNull, bool *isDone);
static bool ExecQualClause(Node *clause, ExprContext *econtext);

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.7 1998/02/26 12:13:09 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.8 1998/09/01 04:28:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -116,7 +116,7 @@ ExecScan(Scan *node,
scanstate->cstate.cs_TupFromTlist = false;
resultSlot = scanstate->cstate.cs_ProjInfo->pi_slot;
return (TupleTableSlot *)
ExecStoreTuple (NULL,
ExecStoreTuple(NULL,
resultSlot,
InvalidBuffer,
true);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.37 1998/09/01 03:22:21 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.38 1998/09/01 04:28:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -57,8 +57,7 @@
#include "utils/lsyscache.h"
#include "utils/mcxt.h"
static void
ExecGetIndexKeyInfo(Form_pg_index indexTuple, int *numAttsOutP,
static void ExecGetIndexKeyInfo(Form_pg_index indexTuple, int *numAttsOutP,
AttrNumber **attsOutP, FuncIndexInfoPtr fInfoP);
/* ----------------------------------------------------------------

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.19 1998/09/01 03:22:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.20 1998/09/01 04:28:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -57,16 +57,13 @@ typedef struct local_es
/* non-export function prototypes */
static TupleDesc postquel_start(execution_state *es);
static execution_state *
init_execution_state(FunctionCachePtr fcache,
static execution_state *init_execution_state(FunctionCachePtr fcache,
char *args[]);
static TupleTableSlot *postquel_getnext(execution_state *es);
static void postquel_end(execution_state *es);
static void
postquel_sub_params(execution_state *es, int nargs,
static void postquel_sub_params(execution_state *es, int nargs,
char *args[], bool *nullV);
static Datum
postquel_execute(execution_state *es, FunctionCachePtr fcache,
static Datum postquel_execute(execution_state *es, FunctionCachePtr fcache,
List *fTlist, char **args, bool *isNull);

View File

@ -117,8 +117,12 @@ ExecAgg(Agg *node)
* ---------------------
*/
/* We loop retrieving groups until we find one matching node->plan.qual */
do {
/*
* We loop retrieving groups until we find one matching
* node->plan.qual
*/
do
{
aggstate = node->aggstate;
if (aggstate->agg_done)
@ -255,10 +259,10 @@ ExecAgg(Agg *node)
{
/*
* when the outerplan doesn't return a single tuple, create a
* dummy heaptuple anyway because we still need to return a
* valid aggregate value. The value returned will be the
* initial values of the transition functions
* when the outerplan doesn't return a single tuple,
* create a dummy heaptuple anyway because we still need
* to return a valid aggregate value. The value returned
* will be the initial values of the transition functions
*/
if (nTuplesAgged == 0)
{
@ -322,15 +326,16 @@ ExecAgg(Agg *node)
int byVal = 0;
/*
* value1 and value2 has not been initialized. This is
* the first non-NULL value. We use it as the initial
* value.
* value1 and value2 has not been initialized.
* This is the first non-NULL value. We use it as
* the initial value.
*/
/*
* but we can't just use it straight, we have to make
* a copy of it since the tuple from which it came
* will be freed on the next iteration of the scan
* but we can't just use it straight, we have to
* make a copy of it since the tuple from which it
* came will be freed on the next iteration of the
* scan
*/
switch (nodeTag(aggregates[i]->target))
{
@ -402,8 +407,9 @@ ExecAgg(Agg *node)
}
/*
* keep this for the projection (we only need one of these - all
* the tuples we aggregate over share the same group column)
* keep this for the projection (we only need one of these -
* all the tuples we aggregate over share the same group
* column)
*/
if (!oneTuple)
oneTuple = heap_copytuple(outerslot->val);
@ -424,8 +430,9 @@ ExecAgg(Agg *node)
{
/*
* No values found for this agg; return current state. This
* seems to fix behavior for avg() aggregate. -tgl 12/96
* No values found for this agg; return current state.
* This seems to fix behavior for avg() aggregate. -tgl
* 12/96
*/
}
else if (aggfns->finalfn.fn_addr != NULL && nTuplesAgged > 0)
@ -448,8 +455,8 @@ ExecAgg(Agg *node)
{
/*
* value in the right place, ignore. (If you remove this case,
* fix the else part. -ay 2/95)
* value in the right place, ignore. (If you remove this
* case, fix the else part. -ay 2/95)
*/
}
else if (aggfns->xfn2.fn_addr != NULL)
@ -484,13 +491,15 @@ ExecAgg(Agg *node)
resultSlot = ExecProject(projInfo, &isDone);
/* As long as the retrieved group does not match the qualifications it is ignored and
* the next group is fetched */
qual_result=ExecQual(fix_opids(node->plan.qual),econtext);
/*
* As long as the retrieved group does not match the
* qualifications it is ignored and the next group is fetched
*/
qual_result = ExecQual(fix_opids(node->plan.qual), econtext);
if (oneTuple)
pfree(oneTuple);
}
while((node->plan.qual!=NULL) && (qual_result!=true));
while ((node->plan.qual != NULL) && (qual_result != true));
return resultSlot;
}

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.14 1998/07/15 22:16:18 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.15 1998/09/01 04:28:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -517,7 +517,7 @@ ExecReScanAppend(Append *node, ExprContext *exprCtxt, Plan *parent)
if (rescanNode->chgParam == NULL)
{
exec_append_initialize_next(node);
ExecReScan((Plan *)rescanNode, exprCtxt, (Plan *) node);
ExecReScan((Plan *) rescanNode, exprCtxt, (Plan *) node);
}
}
appendstate->as_whichplan = 0;

View File

@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive)
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.21 1998/07/16 02:58:09 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.22 1998/09/01 04:28:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -30,8 +30,7 @@
static TupleTableSlot *ExecGroupEveryTuple(Group *node);
static TupleTableSlot *ExecGroupOneTuple(Group *node);
static bool
sameGroup(HeapTuple oldslot, HeapTuple newslot,
static bool sameGroup(HeapTuple oldslot, HeapTuple newslot,
int numCols, AttrNumber *grpColIdx, TupleDesc tupdesc);
/* ---------------------------------------

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.22 1998/09/01 03:22:23 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.23 1998/09/01 04:28:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -45,8 +45,7 @@ static void mk_hj_temp(char *tempname);
static int hashFunc(char *key, int len);
static int ExecHashPartition(Hash *node);
static RelativeAddr hashTableAlloc(int size, HashJoinTable hashtable);
static void
ExecHashOverflowInsert(HashJoinTable hashtable,
static void ExecHashOverflowInsert(HashJoinTable hashtable,
HashBucket bucket,
HeapTuple heapTuple);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.12 1998/09/01 03:22:25 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.13 1998/09/01 04:28:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -28,12 +28,10 @@
static TupleTableSlot *
ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate);
static TupleTableSlot *
ExecHashJoinGetSavedTuple(HashJoinState *hjstate, char *buffer,
static TupleTableSlot *ExecHashJoinGetSavedTuple(HashJoinState *hjstate, char *buffer,
File file, TupleTableSlot *tupleSlot, int *block, char **position);
static int
ExecHashJoinGetBatch(int bucketno, HashJoinTable hashtable,
static int ExecHashJoinGetBatch(int bucketno, HashJoinTable hashtable,
int nbatch);
static int ExecHashJoinNewBatch(HashJoinState *hjstate);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.26 1998/09/01 03:22:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.27 1998/09/01 04:28:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -144,10 +144,11 @@ IndexNext(IndexScan *node)
false); /* don't pfree */
/*
* We must check to see if the current tuple would have been
* matched by an earlier index, so we don't double report it.
* We do this by passing the tuple through ExecQual and look
* for failure with all previous qualifications.
* We must check to see if the current tuple would have
* been matched by an earlier index, so we don't double
* report it. We do this by passing the tuple through
* ExecQual and look for failure with all previous
* qualifications.
*/
for (prev_index = 0; prev_index < indexstate->iss_IndexPtr;
prev_index++)
@ -268,8 +269,7 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
exprCtxt->ecxt_outertuple;
/*
* get the index qualifications and recalculate the appropriate
* values
* get the index qualifications and recalculate the appropriate values
*/
for (i = 0; i < numIndices; i++)
{
@ -282,10 +282,12 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
run_keys = (int *) runtimeKeyInfo[i];
for (j = 0; j < n_keys; j++)
{
/*
* If we have a run-time key, then extract the run-time
* expression and evaluate it with respect to the current
* outer tuple. We then stick the result into the scan key.
* outer tuple. We then stick the result into the scan
* key.
*/
if (run_keys[j] != NO_OP)
{
@ -428,7 +430,7 @@ ExecIndexMarkPos(IndexScan *node)
#if 0
IndexScanMarkPosition(scanDesc);
#endif
index_markpos (scanDesc);
index_markpos(scanDesc);
}
/* ----------------------------------------------------------------
@ -457,7 +459,7 @@ ExecIndexRestrPos(IndexScan *node)
#if 0
IndexScanRestorePosition(scanDesc);
#endif
index_restrpos (scanDesc);
index_restrpos(scanDesc);
}
/* ----------------------------------------------------------------
@ -729,11 +731,11 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
*/
/* Life was so easy before ... subselects */
if ( ((Param *) leftop)->paramkind == PARAM_EXEC )
if (((Param *) leftop)->paramkind == PARAM_EXEC)
{
have_runtime_keys = true;
run_keys[j] = LEFT_OP;
execParam = lappendi (execParam, ((Param*) leftop)->paramid);
execParam = lappendi(execParam, ((Param *) leftop)->paramid);
}
else
{
@ -822,11 +824,11 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
*/
/* Life was so easy before ... subselects */
if ( ((Param *) rightop)->paramkind == PARAM_EXEC )
if (((Param *) rightop)->paramkind == PARAM_EXEC)
{
have_runtime_keys = true;
run_keys[j] = RIGHT_OP;
execParam = lappendi (execParam, ((Param*) rightop)->paramid);
execParam = lappendi(execParam, ((Param *) rightop)->paramid);
}
else
{
@ -994,10 +996,10 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
indexstate->cstate.cs_TupFromTlist = false;
/*
* if there are some PARAM_EXEC in skankeys then
* force index rescan on first scan.
* if there are some PARAM_EXEC in skankeys then force index rescan on
* first scan.
*/
((Plan*) node)->chgParam = execParam;
((Plan *) node)->chgParam = execParam;
/* ----------------
* all done.

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.16 1998/09/01 03:22:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.17 1998/09/01 04:28:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.18 1998/07/19 10:05:19 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.19 1998/09/01 04:28:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -480,8 +480,8 @@ ExecMergeJoin(MergeJoin *node)
* means that this is the first time ExecMergeJoin() has
* been called and so we have to initialize the inner,
* outer and marked tuples as well as various stuff in the
* expression context.
* ********************************
* expression context. ********************************
*
*/
case EXEC_MJ_INITIALIZE:
MJ_printf("ExecMergeJoin: EXEC_MJ_INITIALIZE\n");
@ -526,8 +526,8 @@ ExecMergeJoin(MergeJoin *node)
* ******************************** EXEC_MJ_JOINMARK means
* we have just found a new outer tuple and a possible
* matching inner tuple. This is the case after the
* INITIALIZE, SKIPOUTER or SKIPINNER states.
* ********************************
* INITIALIZE, SKIPOUTER or SKIPINNER states. ********************************
*
*/
case EXEC_MJ_JOINMARK:
MJ_printf("ExecMergeJoin: EXEC_MJ_JOINMARK\n");
@ -655,8 +655,8 @@ ExecMergeJoin(MergeJoin *node)
break;
/*
* ******************************** EXEC_MJ_TESTOUTER
* If the new outer tuple and the marked tuple satisify the
* ******************************** EXEC_MJ_TESTOUTER If
* the new outer tuple and the marked tuple satisify the
* merge clause then we know we have duplicates in the
* outer scan so we have to restore the inner scan to the
* marked tuple and proceed to join the new outer tuples
@ -680,7 +680,9 @@ ExecMergeJoin(MergeJoin *node)
*
* new outer tuple > marked tuple
*
* ****************************
***************************
*
*
*/
case EXEC_MJ_TESTOUTER:
MJ_printf("ExecMergeJoin: EXEC_MJ_TESTOUTER\n");
@ -698,13 +700,14 @@ ExecMergeJoin(MergeJoin *node)
if (qualResult)
{
/*
* the merge clause matched so now we juggle the slots
* back the way they were and proceed to JOINTEST.
*
* I can't understand why we have to go to JOINTEST
* and compare outer tuple with the same inner one
* again -> go to JOINTUPLES... - vadim 02/27/98
* I can't understand why we have to go to JOINTEST and
* compare outer tuple with the same inner one again
* -> go to JOINTUPLES... - vadim 02/27/98
*/
ExecRestrPos(innerPlan);
@ -756,7 +759,9 @@ ExecMergeJoin(MergeJoin *node)
* we have to advance the outer scan until we find the outer
* 8.
*
****************************
**************************
*
*
*
*
*
@ -856,7 +861,9 @@ ExecMergeJoin(MergeJoin *node)
* we have to advance the inner scan until we find the inner
* 12.
*
****************************
**************************
*
*
*
*
*
@ -1166,7 +1173,7 @@ ExecEndMergeJoin(MergeJoin *node)
*/
ExecClearTuple(mergestate->jstate.cs_ResultTupleSlot);
ExecClearTuple(mergestate->mj_MarkedTupleSlot);
pfree (mergestate->mj_MarkedTupleSlot);
pfree(mergestate->mj_MarkedTupleSlot);
mergestate->mj_MarkedTupleSlot = NULL;
MJ1_printf("ExecEndMergeJoin: %s\n",
@ -1189,8 +1196,8 @@ ExecReScanMergeJoin(MergeJoin *node, ExprContext *exprCtxt, Plan *parent)
mergestate->mj_JoinState = EXEC_MJ_INITIALIZE;
/*
* if chgParam of subnodes is not null then plans will be re-scanned by
* first ExecProcNode.
* if chgParam of subnodes is not null then plans will be re-scanned
* by first ExecProcNode.
*/
if (((Plan *) node)->lefttree->chgParam == NULL)
ExecReScan(((Plan *) node)->lefttree, exprCtxt, (Plan *) node);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.13 1998/09/01 03:22:28 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.14 1998/09/01 04:28:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -30,8 +30,7 @@
#include "access/heapam.h"
#include "parser/parsetree.h"
static Oid
InitScanRelation(SeqScan *node, EState *estate,
static Oid InitScanRelation(SeqScan *node, EState *estate,
CommonScanState *scanstate, Plan *outerPlan);
static TupleTableSlot *SeqNext(SeqScan *node);
@ -83,7 +82,8 @@ SeqNext(SeqScan *node)
slot = ExecStoreTuple(tuple,/* tuple to store */
slot, /* slot to store in */
scandesc->rs_cbuf,/* buffer associated with this tuple */
scandesc->rs_cbuf, /* buffer associated with
* this tuple */
false); /* don't pfree this pointer */
/* ----------------

View File

@ -112,7 +112,7 @@ ExecInitSubPlan(SubPlan *node, EState *estate, Plan *parent)
{
EState *sp_estate = CreateExecutorState();
ExecCheckPerms (CMD_SELECT, 0, node->rtable, (Query*) NULL);
ExecCheckPerms(CMD_SELECT, 0, node->rtable, (Query *) NULL);
sp_estate->es_range_table = node->rtable;
sp_estate->es_param_list_info = estate->es_param_list_info;

View File

@ -15,7 +15,7 @@
* ExecEndTee
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.22 1998/09/01 03:22:32 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.23 1998/09/01 04:28:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -365,7 +365,7 @@ ExecTee(Tee *node, Plan *parent)
HeapTuple throwAway;
/* Buffer buffer; */
throwAway = heap_getnext(scanDesc,ScanDirectionIsBackward(dir));
throwAway = heap_getnext(scanDesc, ScanDirectionIsBackward(dir));
}
/*

View File

@ -47,8 +47,7 @@ static int _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount);
static void _SPI_fetch(FetchStmt *stmt);
#endif
static int
_SPI_execute_plan(_SPI_plan *plan,
static int _SPI_execute_plan(_SPI_plan *plan,
Datum *Values, char *Nulls, int tcount);
#define _SPI_CPLAN_CURCXT 0

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.30 1998/09/01 03:22:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.31 1998/09/01 04:28:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.25 1998/09/01 03:22:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.26 1998/09/01 04:28:46 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@ -385,7 +385,8 @@ _lo_commit(void)
for (i = 0; i < MAX_LOBJ_FDS; i++)
{
if (cookies[i] != NULL) inv_cleanindex(cookies[i]);
if (cookies[i] != NULL)
inv_cleanindex(cookies[i]);
}
MemoryContextSwitchTo(currentContext);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.34 1998/09/01 03:22:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.35 1998/09/01 04:28:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -679,7 +679,7 @@ parse_map_record(FILE *file,
return;
}
}
sprintf(PQerrormsg,"Incomplete line in pg_ident: %s",file_map);
sprintf(PQerrormsg, "Incomplete line in pg_ident: %s", file_map);
fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg);
}

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.16 1998/09/01 03:22:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.17 1998/09/01 04:28:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.52 1998/09/01 03:22:50 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.53 1998/09/01 04:28:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -184,7 +184,8 @@ pq_getstr(char *s, int maxlen)
int c = '\0';
#ifdef MULTIBYTE
unsigned char *p, *ps;
unsigned char *p,
*ps;
int len;
ps = s;
@ -203,7 +204,8 @@ pq_getstr(char *s, int maxlen)
#ifdef MULTIBYTE
p = pg_client_to_server(ps, len);
if (ps != p) { /* actual conversion has been done? */
if (ps != p)
{ /* actual conversion has been done? */
strcpy(ps, p);
}
#endif
@ -555,16 +557,18 @@ StreamServerPort(char *hostName, short portName, int *fdP)
strcpy(sock_path, saddr.un.sun_path);
/*
* If the socket exists but nobody has an advisory lock on it
* we can safely delete the file.
* If the socket exists but nobody has an advisory lock on it we
* can safely delete the file.
*/
if ((lock_fd = open(sock_path, O_RDONLY|O_NONBLOCK, 0666)) >= 0) {
if (flock(lock_fd, LOCK_EX|LOCK_NB) == 0) {
if ((lock_fd = open(sock_path, O_RDONLY | O_NONBLOCK, 0666)) >= 0)
{
if (flock(lock_fd, LOCK_EX | LOCK_NB) == 0)
{
TPRINTF(TRACE_VERBOSE, "flock on %s, deleting", sock_path);
unlink(sock_path);
} else {
TPRINTF(TRACE_VERBOSE, "flock failed for %s", sock_path);
}
else
TPRINTF(TRACE_VERBOSE, "flock failed for %s", sock_path);
close(lock_fd);
}
}
@ -584,7 +588,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
strcat(PQerrormsg,
"\tIs another postmaster already running on that port?\n");
if (family == AF_UNIX)
sprintf(PQerrormsg+strlen(PQerrormsg),
sprintf(PQerrormsg + strlen(PQerrormsg),
"\tIf not, remove socket node (%s) and retry.\n",
sock_path);
else
@ -593,19 +597,20 @@ StreamServerPort(char *hostName, short portName, int *fdP)
return STATUS_ERROR;
}
if (family == AF_UNIX) {
if (family == AF_UNIX)
{
on_proc_exit(StreamDoUnlink, NULL);
/*
* Open the socket file and get an advisory lock on it.
* The lock_fd is left open to keep the lock.
* Open the socket file and get an advisory lock on it. The
* lock_fd is left open to keep the lock.
*/
if ((lock_fd = open(sock_path, O_RDONLY|O_NONBLOCK, 0666)) >= 0) {
if (flock(lock_fd, LOCK_EX|LOCK_NB) != 0) {
if ((lock_fd = open(sock_path, O_RDONLY | O_NONBLOCK, 0666)) >= 0)
{
if (flock(lock_fd, LOCK_EX | LOCK_NB) != 0)
TPRINTF(TRACE_VERBOSE, "flock error for %s", sock_path);
}
}
}
listen(fd, SOMAXCONN);
@ -783,4 +788,5 @@ pq_putncharlen(char *s, int n)
pq_putint(len, sizeof(int));
pq_putnchar(p, len);
}
#endif

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.17 1998/08/25 21:22:27 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.18 1998/09/01 04:28:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -118,7 +118,8 @@ PacketReceiveFragment(Packet *pkt, int sock)
* Set up a packet write for the postmaster event loop.
*/
void PacketSendSetup(Packet *pkt, int nbytes, PacketDoneProc iodone, void *arg)
void
PacketSendSetup(Packet *pkt, int nbytes, PacketDoneProc iodone, void *arg)
{
pkt->len = (PacketLen) nbytes;
pkt->nrtodo = nbytes;

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.9 1998/09/01 03:22:52 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.10 1998/09/01 04:28:55 momjian Exp $
*
* NOTES
* This shouldn't be in libpq, but the monitor and some other

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.21 1998/06/15 19:28:28 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.22 1998/09/01 04:28:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.47 1998/09/01 03:22:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.48 1998/09/01 04:29:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -999,7 +999,7 @@ _copyArrayRef(ArrayRef *from)
** -- JMH, 8/2/93
*/
static RelOptInfo *
_copyRelOptInfo(RelOptInfo *from)
_copyRelOptInfo(RelOptInfo * from)
{
RelOptInfo *newnode = makeNode(RelOptInfo);
int i,
@ -1320,7 +1320,7 @@ _copyMergeOrder(MergeOrder *from)
* ----------------
*/
static ClauseInfo *
_copyClauseInfo(ClauseInfo *from)
_copyClauseInfo(ClauseInfo * from)
{
ClauseInfo *newnode = makeNode(ClauseInfo);
@ -1413,7 +1413,7 @@ _copyMInfo(MInfo *from)
* ----------------
*/
static JoinInfo *
_copyJoinInfo(JoinInfo *from)
_copyJoinInfo(JoinInfo * from)
{
JoinInfo *newnode = makeNode(JoinInfo);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.19 1998/09/01 03:22:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.20 1998/09/01 04:29:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -281,7 +281,7 @@ _equalFunc(Func *a, Func *b)
* ClauseInfo is a subclass of Node.
*/
static bool
_equalClauseInfo(ClauseInfo *a, ClauseInfo *b)
_equalClauseInfo(ClauseInfo * a, ClauseInfo * b)
{
Assert(IsA(a, ClauseInfo));
Assert(IsA(b, ClauseInfo));
@ -306,7 +306,7 @@ _equalClauseInfo(ClauseInfo *a, ClauseInfo *b)
* RelOptInfo is a subclass of Node.
*/
static bool
_equalRelOptInfo(RelOptInfo *a, RelOptInfo *b)
_equalRelOptInfo(RelOptInfo * a, RelOptInfo * b)
{
Assert(IsA(a, RelOptInfo));
Assert(IsA(b, RelOptInfo));
@ -530,7 +530,7 @@ _equalSubPlan(SubPlan *a, SubPlan *b)
}
static bool
_equalJoinInfo(JoinInfo *a, JoinInfo *b)
_equalJoinInfo(JoinInfo * a, JoinInfo * b)
{
Assert(IsA(a, JoinInfo));
Assert(IsA(b, JoinInfo));

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.14 1998/09/01 03:22:56 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.15 1998/09/01 04:29:05 momjian Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.45 1998/09/01 03:22:59 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.46 1998/09/01 04:29:07 momjian Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
@ -129,6 +129,7 @@ _outFuncCall(StringInfo str, FuncCall *node)
appendStringInfo(str, " :args ");
_outNode(str, node->args);
}
#endif
static void
@ -660,7 +661,8 @@ _outResdom(StringInfo str, Resdom *node)
sprintf(buf, " :restypmod %d ", node->restypmod);
appendStringInfo(str, buf);
appendStringInfo(str, " :resname ");
sprintf(buf,"\"%s\"", node->resname); /* fix for SELECT col AS "my name" */
sprintf(buf, "\"%s\"", node->resname); /* fix for SELECT col AS
* "my name" */
appendStringInfo(str, buf);
sprintf(buf, " :reskey %d ", node->reskey);
appendStringInfo(str, buf);
@ -990,7 +992,7 @@ _outEState(StringInfo str, EState *node)
* Stuff from relation.h
*/
static void
_outRelOptInfo(StringInfo str, RelOptInfo *node)
_outRelOptInfo(StringInfo str, RelOptInfo * node)
{
char buf[500];
@ -1356,7 +1358,7 @@ _outMergeOrder(StringInfo str, MergeOrder *node)
* ClauseInfo is a subclass of Node.
*/
static void
_outClauseInfo(StringInfo str, ClauseInfo *node)
_outClauseInfo(StringInfo str, ClauseInfo * node)
{
char buf[500];
@ -1424,7 +1426,7 @@ _outHInfo(StringInfo str, HInfo *node)
* JoinInfo is a subclass of Node.
*/
static void
_outJoinInfo(StringInfo str, JoinInfo *node)
_outJoinInfo(StringInfo str, JoinInfo * node)
{
appendStringInfo(str, " JINFO ");

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.17 1998/08/16 05:35:35 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.18 1998/09/01 04:29:10 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -201,7 +201,7 @@ print_expr(Node *expr, List *rtable)
print_expr((Node *) get_leftop(e), rtable);
opname = get_opname(((Oper *) e->oper)->opno);
printf(" %s ", ((opname != NULL)? opname: "(invalid operator)"));
printf(" %s ", ((opname != NULL) ? opname : "(invalid operator)"));
print_expr((Node *) get_rightop(e), rtable);
}
else
@ -392,13 +392,16 @@ print_plan_recursive(Plan *p, Query *parsetree, int indentLevel, char *label)
{
List *lst;
int whichplan = 0;
Append *appendplan = (Append *)p;
Append *appendplan = (Append *) p;
foreach(lst, appendplan->appendplans)
{
Plan *subnode = (Plan *)lfirst(lst);
Plan *subnode = (Plan *) lfirst(lst);
/* I don't think we need to fiddle with the range table here, bjm */
/*
* I don't think we need to fiddle with the range table here,
* bjm
*/
print_plan_recursive(subnode, parsetree, indentLevel + 3, "a: ");
whichplan++;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.36 1998/09/01 03:23:03 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.37 1998/09/01 04:29:12 momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
@ -716,7 +716,7 @@ _readResdom()
else
{
local_node->resname = (char *) palloc(length + 1);
StrNCpy(local_node->resname, token+1, length + 1 - 2);/* strip quotes */
StrNCpy(local_node->resname, token + 1, length + 1 - 2); /* strip quotes */
}
token = lsptok(NULL, &length); /* eat :reskey */

View File

@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_eval.c,v 1.23 1998/09/01 03:23:07 momjian Exp $
* $Id: geqo_eval.c,v 1.24 1998/09/01 04:29:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -50,12 +50,12 @@
#include "optimizer/geqo_paths.h"
static List *gimme_clause_joins(Query *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel);
static RelOptInfo *gimme_clauseless_join(RelOptInfo *outer_rel, RelOptInfo *inner_rel);
static RelOptInfo *init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *joininfo);
static List *gimme_clause_joins(Query *root, RelOptInfo * outer_rel, RelOptInfo * inner_rel);
static RelOptInfo *gimme_clauseless_join(RelOptInfo * outer_rel, RelOptInfo * inner_rel);
static RelOptInfo *init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo);
static List *new_join_tlist(List *tlist, List *other_relids, int first_resdomno);
static List *new_joininfo_list(List *joininfo_list, List *join_relids);
static void geqo_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel);
static void geqo_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel);
static RelOptInfo *geqo_nth(int stop, List *rels);
/*
@ -99,7 +99,7 @@ geqo_eval(Query *root, Gene *tour, int num_gene)
* Returns a new join relation incorporating all joins in a left-sided tree.
*/
RelOptInfo *
gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo *outer_rel)
gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo * outer_rel)
{
RelOptInfo *inner_rel; /* current relation */
int base_rel_index;
@ -189,7 +189,7 @@ gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, RelOptInfo *out
*/
static List *
gimme_clause_joins(Query *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
gimme_clause_joins(Query *root, RelOptInfo * outer_rel, RelOptInfo * inner_rel)
{
List *join_list = NIL;
List *i = NIL;
@ -240,7 +240,7 @@ gimme_clause_joins(Query *root, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
*/
static RelOptInfo *
gimme_clauseless_join(RelOptInfo *outer_rel, RelOptInfo *inner_rel)
gimme_clauseless_join(RelOptInfo * outer_rel, RelOptInfo * inner_rel)
{
return init_join_rel(outer_rel, inner_rel, (JoinInfo *) NULL);
}
@ -257,7 +257,7 @@ gimme_clauseless_join(RelOptInfo *outer_rel, RelOptInfo *inner_rel)
* Returns the new join relation node.
*/
static RelOptInfo *
init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *joininfo)
init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo)
{
RelOptInfo *joinrel = makeNode(RelOptInfo);
List *joinrel_joininfo_list = NIL;
@ -477,8 +477,8 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
*/
/*
* ! BUG BUG ! Relid relid = (Relid)lfirst(xrelid); RelOptInfo *rel =
* get_join_rel(root, relid);
* ! BUG BUG ! Relid relid = (Relid)lfirst(xrelid); RelOptInfo
* *rel = get_join_rel(root, relid);
*/
/*
@ -516,8 +516,8 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
{
/*
* ! BUG BUG ! Relid relid = (Relid)lfirst(xrelid); RelOptInfo
* *rel = get_join_rel(root, relid);
* ! BUG BUG ! Relid relid = (Relid)lfirst(xrelid);
* RelOptInfo *rel = get_join_rel(root, relid);
*/
/*
@ -645,7 +645,7 @@ geqo_final_join_rels(List *join_rel_list)
* Modifies the superrels field of rel
*/
static void
add_superrels(RelOptInfo *rel, RelOptInfo *super_rel)
add_superrels(RelOptInfo * rel, RelOptInfo * super_rel)
{
rel->superrels = lappend(rel->superrels, super_rel);
}
@ -660,7 +660,7 @@ add_superrels(RelOptInfo *rel, RelOptInfo *super_rel)
* Returns non-nil if rel1 and rel2 do not overlap.
*/
static bool
nonoverlap_rels(RelOptInfo *rel1, RelOptInfo *rel2)
nonoverlap_rels(RelOptInfo * rel1, RelOptInfo * rel2)
{
return nonoverlap_sets(rel1->relids, rel2->relids);
}
@ -688,7 +688,7 @@ nonoverlap_sets(List *s1, List *s2)
* long join queries; so get logarithm of size when MAXINT overflow;
*/
static void
geqo_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel)
geqo_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel)
{
Cost temp;
int ntuples;

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_main.c,v 1.10 1998/09/01 03:23:09 momjian Exp $
* $Id: geqo_main.c,v 1.11 1998/09/01 04:29:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_misc.c,v 1.10 1998/09/01 03:23:10 momjian Exp $
* $Id: geqo_misc.c,v 1.11 1998/09/01 04:29:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -262,7 +262,7 @@ geqo_print_path(Query *root, Path *path, int indent)
}
void
geqo_print_rel(Query *root, RelOptInfo *rel)
geqo_print_rel(Query *root, RelOptInfo * rel)
{
List *l;

View File

@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: geqo_paths.c,v 1.11 1998/09/01 03:23:12 momjian Exp $
* $Id: geqo_paths.c,v 1.12 1998/09/01 04:29:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -28,8 +28,8 @@
#include "optimizer/geqo_paths.h"
static List *geqo_prune_rel(RelOptInfo *rel, List *other_rels);
static Path *set_paths(RelOptInfo *rel, Path *unorderedpath);
static List *geqo_prune_rel(RelOptInfo * rel, List *other_rels);
static Path *set_paths(RelOptInfo * rel, Path *unorderedpath);
/*
* geqo-prune-rels--
@ -65,7 +65,7 @@ geqo_prune_rels(List *rel_list)
*
*/
static List *
geqo_prune_rel(RelOptInfo *rel, List *other_rels)
geqo_prune_rel(RelOptInfo * rel, List *other_rels)
{
List *i = NIL;
List *t_list = NIL;
@ -102,7 +102,7 @@ geqo_prune_rel(RelOptInfo *rel, List *other_rels)
*
*/
void
geqo_rel_paths(RelOptInfo *rel)
geqo_rel_paths(RelOptInfo * rel)
{
List *y = NIL;
Path *path = (Path *) NULL;
@ -134,7 +134,7 @@ geqo_rel_paths(RelOptInfo *rel)
*
*/
static Path *
set_paths(RelOptInfo *rel, Path *unorderedpath)
set_paths(RelOptInfo * rel, Path *unorderedpath)
{
Path *cheapest = set_cheapest(rel, rel->pathlist);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.7 1998/08/10 02:26:19 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.8 1998/09/01 04:29:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -41,7 +41,7 @@
*/
void
minspantree(Query *root, List *join_rels, RelOptInfo *garel)
minspantree(Query *root, List *join_rels, RelOptInfo * garel)
{
int number_of_rels = length(root->base_rel_list);
int number_of_joins = length(join_rels);
@ -111,9 +111,9 @@ minspantree(Query *root, List *join_rels, RelOptInfo *garel)
else if (number_of_joins == 3)
{
RelOptInfo *rel12 = (RelOptInfo *) &tmprel_array[1][2];
RelOptInfo *rel13 = (RelOptInfo *) &tmprel_array[1][3];
RelOptInfo *rel23 = (RelOptInfo *) &tmprel_array[2][3];
RelOptInfo *rel12 = (RelOptInfo *) & tmprel_array[1][2];
RelOptInfo *rel13 = (RelOptInfo *) & tmprel_array[1][3];
RelOptInfo *rel23 = (RelOptInfo *) & tmprel_array[2][3];
if (rel12->cheapestpath->path_cost > rel13->cheapestpath->path_cost)
{
@ -159,9 +159,9 @@ minspantree(Query *root, List *join_rels, RelOptInfo *garel)
if (connectto[tempn] != 0)
{
if (n > tempn)
joinrel = (RelOptInfo *) &tmprel_array[tempn][n];
joinrel = (RelOptInfo *) & tmprel_array[tempn][n];
else
joinrel = (RelOptInfo *) &tmprel_array[n][tempn];
joinrel = (RelOptInfo *) & tmprel_array[n][tempn];
dist = joinrel->cheapestpath->path_cost;
if (dist < disttoconnect[tempn])

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.22 1998/09/01 03:23:17 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.23 1998/09/01 04:29:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -45,8 +45,10 @@ int32 _use_geqo_rels_ = GEQO_RELS;
static void find_rel_paths(Query *root, List *rels);
static List *find_join_paths(Query *root, List *outer_rels, int levels_needed);
#ifdef OPTIMIZER_DEBUG
static void debug_print_rel(Query *root, RelOptInfo *rel);
static void debug_print_rel(Query *root, RelOptInfo * rel);
#endif
/*
@ -76,6 +78,7 @@ find_paths(Query *root, List *rels)
if (levels_needed <= 1)
{
/*
* Unsorted single relation, no more processing is required.
*/
@ -83,6 +86,7 @@ find_paths(Query *root, List *rels)
}
else
{
/*
* this means that joins or sorts are required. set selectivities
* of clauses that have not been set by an index.
@ -180,7 +184,8 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
*******************************************/
if ((_use_geqo_) && length(root->base_rel_list) >= _use_geqo_rels_)
return lcons(geqo(root), NIL); /* returns *one* RelOptInfo, so lcons it */
return lcons(geqo(root), NIL); /* returns *one* RelOptInfo, so
* lcons it */
/*******************************************
* rest will be deprecated in case of GEQO *
@ -396,7 +401,7 @@ print_path(Query *root, Path *path, int indent)
}
static void
debug_print_rel(Query *root, RelOptInfo *rel)
debug_print_rel(Query *root, RelOptInfo * rel)
{
List *l;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.12 1998/09/01 03:23:19 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.13 1998/09/01 04:29:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -160,7 +160,7 @@ Cost
compute_clause_selec(Query *root, Node *clause, List *or_selectivities)
{
if (is_opclause(clause))
return compute_selec(root, lcons(clause,NIL), or_selectivities);
return compute_selec(root, lcons(clause, NIL), or_selectivities);
else if (not_clause(clause))
{
@ -182,9 +182,7 @@ compute_clause_selec(Query *root, Node *clause, List *or_selectivities)
return compute_selec(root, ((Expr *) clause)->args, or_selectivities);
}
else
{
return compute_selec(root, lcons(clause, NIL), or_selectivities);
}
}
/*

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.24 1998/09/01 03:23:20 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.25 1998/09/01 04:29:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -360,7 +360,7 @@ cost_hashjoin(Cost outercost,
* Returns the size.
*/
int
compute_rel_size(RelOptInfo *rel)
compute_rel_size(RelOptInfo * rel)
{
Cost temp;
int temp1;
@ -383,7 +383,7 @@ compute_rel_size(RelOptInfo *rel)
* Returns the width of the tuple as a fixnum.
*/
int
compute_rel_width(RelOptInfo *rel)
compute_rel_width(RelOptInfo * rel)
{
return compute_targetlist_width(get_actual_tlist(rel->targetlist));
}

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.6 1998/09/01 03:23:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.7 1998/09/01 04:29:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.33 1998/09/01 03:23:23 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.34 1998/09/01 04:29:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -41,46 +41,36 @@
#include "parser/parsetree.h" /* for getrelid() */
#include "parser/parse_expr.h" /* for exprType() */
#include "parser/parse_oper.h" /* for oprid() and oper() */
#include "parser/parse_coerce.h" /* for IS_BINARY_COMPATIBLE() */
#include "parser/parse_coerce.h"/* for IS_BINARY_COMPATIBLE() */
#include "utils/lsyscache.h"
static void
match_index_orclauses(RelOptInfo *rel, RelOptInfo *index, int indexkey,
static void match_index_orclauses(RelOptInfo * rel, RelOptInfo * index, int indexkey,
int xclass, List *clauseinfo_list);
static bool
match_index_to_operand(int indexkey, Expr *operand,
RelOptInfo *rel, RelOptInfo *index);
static List *
match_index_orclause(RelOptInfo *rel, RelOptInfo *index, int indexkey,
static bool match_index_to_operand(int indexkey, Expr *operand,
RelOptInfo * rel, RelOptInfo * index);
static List *match_index_orclause(RelOptInfo * rel, RelOptInfo * index, int indexkey,
int xclass, List *or_clauses, List *other_matching_indices);
static List *
group_clauses_by_indexkey(RelOptInfo *rel, RelOptInfo *index,
static List *group_clauses_by_indexkey(RelOptInfo * rel, RelOptInfo * index,
int *indexkeys, Oid *classes, List *clauseinfo_list);
static List *
group_clauses_by_ikey_for_joins(RelOptInfo *rel, RelOptInfo *index,
static List *group_clauses_by_ikey_for_joins(RelOptInfo * rel, RelOptInfo * index,
int *indexkeys, Oid *classes, List *join_cinfo_list, List *restr_cinfo_list);
static ClauseInfo *
match_clause_to_indexkey(RelOptInfo *rel, RelOptInfo *index, int indexkey,
int xclass, ClauseInfo *clauseInfo, bool join);
static bool
pred_test(List *predicate_list, List *clauseinfo_list,
static ClauseInfo *match_clause_to_indexkey(RelOptInfo * rel, RelOptInfo * index, int indexkey,
int xclass, ClauseInfo * clauseInfo, bool join);
static bool pred_test(List *predicate_list, List *clauseinfo_list,
List *joininfo_list);
static bool one_pred_test(Expr *predicate, List *clauseinfo_list);
static bool one_pred_clause_expr_test(Expr *predicate, Node *clause);
static bool one_pred_clause_test(Expr *predicate, Node *clause);
static bool clause_pred_clause_test(Expr *predicate, Node *clause);
static List *
indexable_joinclauses(RelOptInfo *rel, RelOptInfo *index,
static List *indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index,
List *joininfo_list, List *clauseinfo_list);
static List *
index_innerjoin(Query *root, RelOptInfo *rel,
List *clausegroup_list, RelOptInfo *index);
static List *
create_index_paths(Query *root, RelOptInfo *rel, RelOptInfo *index,
static List *index_innerjoin(Query *root, RelOptInfo * rel,
List *clausegroup_list, RelOptInfo * index);
static List *create_index_paths(Query *root, RelOptInfo * rel, RelOptInfo * index,
List *clausegroup_list, bool join);
static List *add_index_paths(List *indexpaths, List *new_indexpaths);
static bool function_index_operand(Expr *funcOpnd, RelOptInfo *rel, RelOptInfo *index);
static bool function_index_operand(Expr *funcOpnd, RelOptInfo * rel, RelOptInfo * index);
/* find_index_paths()
@ -110,7 +100,7 @@ static bool function_index_operand(Expr *funcOpnd, RelOptInfo *rel, RelOptInfo *
*/
List *
find_index_paths(Query *root,
RelOptInfo *rel,
RelOptInfo * rel,
List *indices,
List *clauseinfo_list,
List *joininfo_list)
@ -127,7 +117,10 @@ find_index_paths(Query *root,
{
index = (RelOptInfo *) lfirst(ilist);
/* If this is a partial index, return if it fails the predicate test */
/*
* If this is a partial index, return if it fails the predicate
* test
*/
if (index->indpred != NIL)
if (!pred_test(index->indpred, clauseinfo_list, joininfo_list))
continue;
@ -136,9 +129,9 @@ find_index_paths(Query *root,
* 1. Try matching the index against subclauses of an 'or' clause.
* The fields of the clauseinfo nodes are marked with lists of the
* matching indices. No path are actually created. We currently
* only look to match the first key. We don't find multi-key index
* cases where an AND matches the first key, and the OR matches the
* second key.
* only look to match the first key. We don't find multi-key
* index cases where an AND matches the first key, and the OR
* matches the second key.
*/
match_index_orclauses(rel,
index,
@ -147,9 +140,9 @@ find_index_paths(Query *root,
clauseinfo_list);
/*
* 2. If the keys of this index match any of the available restriction
* clauses, then create pathnodes corresponding to each group of
* usable clauses.
* 2. If the keys of this index match any of the available
* restriction clauses, then create pathnodes corresponding to
* each group of usable clauses.
*/
scanclausegroups = group_clauses_by_indexkey(rel,
index,
@ -167,10 +160,10 @@ find_index_paths(Query *root,
/*
* 3. If this index can be used with any join clause, then create
* pathnodes for each group of usable clauses. An index can be used
* with a join clause if its ordering is useful for a mergejoin, or if
* the index can possibly be used for scanning the inner relation of a
* nestloop join.
* pathnodes for each group of usable clauses. An index can be
* used with a join clause if its ordering is useful for a
* mergejoin, or if the index can possibly be used for scanning
* the inner relation of a nestloop join.
*/
joinclausegroups = indexable_joinclauses(rel, index, joininfo_list, clauseinfo_list);
joinpaths = NIL;
@ -225,8 +218,8 @@ find_index_paths(Query *root,
*
*/
static void
match_index_orclauses(RelOptInfo *rel,
RelOptInfo *index,
match_index_orclauses(RelOptInfo * rel,
RelOptInfo * index,
int indexkey,
int xclass,
List *clauseinfo_list)
@ -262,8 +255,8 @@ match_index_orclauses(RelOptInfo *rel,
static bool
match_index_to_operand(int indexkey,
Expr *operand,
RelOptInfo *rel,
RelOptInfo *index)
RelOptInfo * rel,
RelOptInfo * index)
{
bool result;
@ -305,8 +298,8 @@ match_index_to_operand(int indexkey,
* match the third, g,h match the fourth, etc.
*/
static List *
match_index_orclause(RelOptInfo *rel,
RelOptInfo *index,
match_index_orclause(RelOptInfo * rel,
RelOptInfo * index,
int indexkey,
int xclass,
List *or_clauses,
@ -323,7 +316,8 @@ match_index_orclause(RelOptInfo *rel,
foreach(clist, or_clauses)
matching_indices = lcons(NIL, matching_indices);
}
else matching_indices = other_matching_indices;
else
matching_indices = other_matching_indices;
index_list = matching_indices;
@ -344,9 +338,7 @@ match_index_orclause(RelOptInfo *rel,
rel,
index) &&
IsA(get_leftop((Expr *) clause), Const))))
{
lfirst(matching_indices) = lcons(index, lfirst(matching_indices));
}
matching_indices = lnext(matching_indices);
}
@ -396,8 +388,8 @@ match_index_orclause(RelOptInfo *rel,
*
*/
static List *
group_clauses_by_indexkey(RelOptInfo *rel,
RelOptInfo *index,
group_clauses_by_indexkey(RelOptInfo * rel,
RelOptInfo * index,
int *indexkeys,
Oid *classes,
List *clauseinfo_list)
@ -458,8 +450,8 @@ group_clauses_by_indexkey(RelOptInfo *rel,
*
*/
static List *
group_clauses_by_ikey_for_joins(RelOptInfo *rel,
RelOptInfo *index,
group_clauses_by_ikey_for_joins(RelOptInfo * rel,
RelOptInfo * index,
int *indexkeys,
Oid *classes,
List *join_cinfo_list,
@ -580,11 +572,11 @@ group_clauses_by_ikey_for_joins(RelOptInfo *rel,
*
*/
static ClauseInfo *
match_clause_to_indexkey(RelOptInfo *rel,
RelOptInfo *index,
match_clause_to_indexkey(RelOptInfo * rel,
RelOptInfo * index,
int indexkey,
int xclass,
ClauseInfo *clauseInfo,
ClauseInfo * clauseInfo,
bool join)
{
Expr *clause = clauseInfo->clause;
@ -607,6 +599,7 @@ match_clause_to_indexkey(RelOptInfo *rel,
*/
if (!join)
{
/*
* Check for standard s-argable clause
*/
@ -622,19 +615,23 @@ match_clause_to_indexkey(RelOptInfo *rel,
index));
#ifndef IGNORE_BINARY_COMPATIBLE_INDICES
/* Didn't find an index?
* Then maybe we can find another binary-compatible index instead...
* thomas 1998-08-14
/*
* Didn't find an index? Then maybe we can find another
* binary-compatible index instead... thomas 1998-08-14
*/
if (! isIndexable)
if (!isIndexable)
{
Oid ltype;
Oid rtype;
ltype = exprType((Node *)leftop);
rtype = exprType((Node *)rightop);
ltype = exprType((Node *) leftop);
rtype = exprType((Node *) rightop);
/* make sure we have two different binary-compatible types... */
/*
* make sure we have two different binary-compatible
* types...
*/
if ((ltype != rtype)
&& IS_BINARY_COMPATIBLE(ltype, rtype))
{
@ -660,12 +657,10 @@ match_clause_to_indexkey(RelOptInfo *rel,
index));
if (isIndexable)
{
((Oper *) ((Expr *) clause)->oper)->opno = restrict_op;
}
}
}
}
#endif
}
@ -684,13 +679,13 @@ match_clause_to_indexkey(RelOptInfo *rel,
indexkey, rel, index));
#ifndef IGNORE_BINARY_COMPATIBLE_INDICES
if (! isIndexable)
if (!isIndexable)
{
Oid ltype;
Oid rtype;
ltype = exprType((Node *)leftop);
rtype = exprType((Node *)rightop);
ltype = exprType((Node *) leftop);
rtype = exprType((Node *) rightop);
if ((ltype != rtype)
&& IS_BINARY_COMPATIBLE(ltype, rtype))
@ -719,16 +714,15 @@ match_clause_to_indexkey(RelOptInfo *rel,
index));
if (isIndexable)
{
((Oper *) ((Expr *) clause)->oper)->opno = oprid(newop);
}
}
}
}
#endif
if (isIndexable)
{
/*
* In place list modification. (op const var/func) -> (op
* var/func const)
@ -1193,7 +1187,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
*
*/
static List *
indexable_joinclauses(RelOptInfo *rel, RelOptInfo *index,
indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index,
List *joininfo_list, List *clauseinfo_list)
{
JoinInfo *joininfo = (JoinInfo *) NULL;
@ -1267,8 +1261,8 @@ extract_restrict_clauses(List *clausegroup)
*
*/
static List *
index_innerjoin(Query *root, RelOptInfo *rel, List *clausegroup_list,
RelOptInfo *index)
index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
RelOptInfo * index)
{
List *clausegroup = NIL;
List *cg_list = NIL;
@ -1354,8 +1348,8 @@ index_innerjoin(Query *root, RelOptInfo *rel, List *clausegroup_list,
*/
static List *
create_index_paths(Query *root,
RelOptInfo *rel,
RelOptInfo *index,
RelOptInfo * rel,
RelOptInfo * index,
List *clausegroup_list,
bool join)
{
@ -1399,7 +1393,7 @@ add_index_paths(List *indexpaths, List *new_indexpaths)
}
static bool
function_index_operand(Expr *funcOpnd, RelOptInfo *rel, RelOptInfo *index)
function_index_operand(Expr *funcOpnd, RelOptInfo * rel, RelOptInfo * index)
{
Oid heapRelid = (Oid) lfirsti(rel->relids);
Func *function;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.9 1998/09/01 03:23:24 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.10 1998/09/01 04:29:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -30,19 +30,15 @@
* _enable_mergejoin} */
static Path *best_innerjoin(List *join_paths, List *outer_relid);
static List *
sort_inner_and_outer(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel,
static List *sort_inner_and_outer(RelOptInfo * joinrel, RelOptInfo * outerrel, RelOptInfo * innerrel,
List *mergeinfo_list);
static List *
match_unsorted_outer(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel,
static List *match_unsorted_outer(RelOptInfo * joinrel, RelOptInfo * outerrel, RelOptInfo * innerrel,
List *outerpath_list, Path *cheapest_inner, Path *best_innerjoin,
List *mergeinfo_list);
static List *
match_unsorted_inner(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel,
static List *match_unsorted_inner(RelOptInfo * joinrel, RelOptInfo * outerrel, RelOptInfo * innerrel,
List *innerpath_list, List *mergeinfo_list);
static bool EnoughMemoryForHashjoin(RelOptInfo *hashrel);
static List *
hash_inner_and_outer(RelOptInfo *joinrel, RelOptInfo *outerrel, RelOptInfo *innerrel,
static bool EnoughMemoryForHashjoin(RelOptInfo * hashrel);
static List *hash_inner_and_outer(RelOptInfo * joinrel, RelOptInfo * outerrel, RelOptInfo * innerrel,
List *hashinfo_list);
/*
@ -238,9 +234,9 @@ best_innerjoin(List *join_paths, List *outer_relids)
* Returns a list of mergejoin paths.
*/
static List *
sort_inner_and_outer(RelOptInfo *joinrel,
RelOptInfo *outerrel,
RelOptInfo *innerrel,
sort_inner_and_outer(RelOptInfo * joinrel,
RelOptInfo * outerrel,
RelOptInfo * innerrel,
List *mergeinfo_list)
{
List *ms_list = NIL;
@ -316,9 +312,9 @@ sort_inner_and_outer(RelOptInfo *joinrel,
* Returns a list of possible join path nodes.
*/
static List *
match_unsorted_outer(RelOptInfo *joinrel,
RelOptInfo *outerrel,
RelOptInfo *innerrel,
match_unsorted_outer(RelOptInfo * joinrel,
RelOptInfo * outerrel,
RelOptInfo * innerrel,
List *outerpath_list,
Path *cheapest_inner,
Path *best_innerjoin,
@ -469,9 +465,9 @@ match_unsorted_outer(RelOptInfo *joinrel,
* Returns a list of possible merge paths.
*/
static List *
match_unsorted_inner(RelOptInfo *joinrel,
RelOptInfo *outerrel,
RelOptInfo *innerrel,
match_unsorted_inner(RelOptInfo * joinrel,
RelOptInfo * outerrel,
RelOptInfo * innerrel,
List *innerpath_list,
List *mergeinfo_list)
{
@ -565,7 +561,7 @@ match_unsorted_inner(RelOptInfo *joinrel,
}
static bool
EnoughMemoryForHashjoin(RelOptInfo *hashrel)
EnoughMemoryForHashjoin(RelOptInfo * hashrel)
{
int ntuples;
int tupsize;
@ -599,9 +595,9 @@ EnoughMemoryForHashjoin(RelOptInfo *hashrel)
* Returns a list of hashjoin paths.
*/
static List *
hash_inner_and_outer(RelOptInfo *joinrel,
RelOptInfo *outerrel,
RelOptInfo *innerrel,
hash_inner_and_outer(RelOptInfo * joinrel,
RelOptInfo * outerrel,
RelOptInfo * innerrel,
List *hashinfo_list)
{
HInfo *xhashinfo = (HInfo *) NULL;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.14 1998/09/01 03:23:25 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.15 1998/09/01 04:29:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -31,19 +31,17 @@ bool _use_right_sided_plans_ = false;
#endif
static List *find_clause_joins(Query *root, RelOptInfo *outer_rel, List *joininfo_list);
static List *find_clauseless_joins(RelOptInfo *outer_rel, List *inner_rels);
static RelOptInfo *init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *joininfo);
static List *
new_join_tlist(List *tlist, List *other_relids,
static List *find_clause_joins(Query *root, RelOptInfo * outer_rel, List *joininfo_list);
static List *find_clauseless_joins(RelOptInfo * outer_rel, List *inner_rels);
static RelOptInfo *init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo);
static List *new_join_tlist(List *tlist, List *other_relids,
int first_resdomno);
static List *new_joininfo_list(List *joininfo_list, List *join_relids);
static void add_superrels(RelOptInfo *rel, RelOptInfo *super_rel);
static bool nonoverlap_rels(RelOptInfo *rel1, RelOptInfo *rel2);
static void add_superrels(RelOptInfo * rel, RelOptInfo * super_rel);
static bool nonoverlap_rels(RelOptInfo * rel1, RelOptInfo * rel2);
static bool nonoverlap_sets(List *s1, List *s2);
static void
set_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel,
JoinInfo *jinfo);
static void set_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel,
JoinInfo * jinfo);
/*
* find-join-rels--
@ -99,7 +97,7 @@ find_join_rels(Query *root, List *outer_rels)
* Returns a list of new join relations.
*/
static List *
find_clause_joins(Query *root, RelOptInfo *outer_rel, List *joininfo_list)
find_clause_joins(Query *root, RelOptInfo * outer_rel, List *joininfo_list)
{
List *join_list = NIL;
List *i = NIL;
@ -158,7 +156,7 @@ find_clause_joins(Query *root, RelOptInfo *outer_rel, List *joininfo_list)
* Returns a list of new join relations.
*/
static List *
find_clauseless_joins(RelOptInfo *outer_rel, List *inner_rels)
find_clauseless_joins(RelOptInfo * outer_rel, List *inner_rels)
{
RelOptInfo *inner_rel;
List *t_list = NIL;
@ -193,7 +191,7 @@ find_clauseless_joins(RelOptInfo *outer_rel, List *inner_rels)
* Returns the new join relation node.
*/
static RelOptInfo *
init_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *joininfo)
init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo)
{
RelOptInfo *joinrel = makeNode(RelOptInfo);
List *joinrel_joininfo_list = NIL;
@ -533,7 +531,7 @@ final_join_rels(List *join_rel_list)
* Modifies the superrels field of rel
*/
static void
add_superrels(RelOptInfo *rel, RelOptInfo *super_rel)
add_superrels(RelOptInfo * rel, RelOptInfo * super_rel)
{
rel->superrels = lappend(rel->superrels, super_rel);
}
@ -548,7 +546,7 @@ add_superrels(RelOptInfo *rel, RelOptInfo *super_rel)
* Returns non-nil if rel1 and rel2 do not overlap.
*/
static bool
nonoverlap_rels(RelOptInfo *rel1, RelOptInfo *rel2)
nonoverlap_rels(RelOptInfo * rel1, RelOptInfo * rel2)
{
return nonoverlap_sets(rel1->relids, rel2->relids);
}
@ -569,7 +567,7 @@ nonoverlap_sets(List *s1, List *s2)
}
static void
set_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *jinfo)
set_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * jinfo)
{
int ntuples;
float selec;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.7 1998/09/01 03:23:27 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.8 1998/09/01 04:29:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -26,18 +26,14 @@
#include "optimizer/ordering.h"
static int
match_pathkey_joinkeys(List *pathkey, List *joinkeys,
static int match_pathkey_joinkeys(List *pathkey, List *joinkeys,
int which_subkey);
static bool
every_func(List *joinkeys, List *pathkey,
static bool every_func(List *joinkeys, List *pathkey,
int which_subkey);
static List *
new_join_pathkey(List *subkeys,
static List *new_join_pathkey(List *subkeys,
List *considered_subkeys, List *join_rel_tlist,
List *joinclauses);
static List *
new_matching_subkeys(Var *subkey, List *considered_subkeys,
static List *new_matching_subkeys(Var *subkey, List *considered_subkeys,
List *join_rel_tlist, List *joinclauses);
/****************************************************************************

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.8 1998/09/01 03:23:28 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.9 1998/09/01 04:29:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/

Some files were not shown because too many files have changed in this diff Show More