1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-09 02:08:45 +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 * 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 * NOTES
* The old interface functions have been converted to macros * The old interface functions have been converted to macros
@@ -935,7 +935,8 @@ heap_modifytuple(HeapTuple tuple,
(char *) &tuple->t_oid, (char *) &tuple->t_oid,
((char *) &tuple->t_hoff - (char *) &tuple->t_oid)); /* XXX */ ((char *) &tuple->t_hoff - (char *) &tuple->t_oid)); /* XXX */
newTuple->t_infomask = infomask; 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; return newTuple;
} }

View File

@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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; Datum attr;
bool isnull; bool isnull;
Oid typoutput; Oid typoutput;
#ifdef MULTIBYTE #ifdef MULTIBYTE
unsigned char *p; unsigned char *p;
#endif #endif
/* ---------------- /* ----------------

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be * some of the executor utility code such as "ExecTypeFromTL" should be

View File

@@ -33,42 +33,32 @@
#endif #endif
/* non-export function prototypes */ /* non-export function prototypes */
static InsertIndexResult static InsertIndexResult gistdoinsert(Relation r, IndexTuple itup,
gistdoinsert(Relation r, IndexTuple itup,
GISTSTATE *GISTstate); GISTSTATE *GISTstate);
static InsertIndexResult static InsertIndexResult gistentryinsert(Relation r, GISTSTACK *stk,
gistentryinsert(Relation r, GISTSTACK *stk,
IndexTuple tup, IndexTuple tup,
GISTSTATE *giststate); GISTSTATE *giststate);
static void static void gistentryinserttwo(Relation r, GISTSTACK *stk, IndexTuple ltup,
gistentryinserttwo(Relation r, GISTSTACK *stk, IndexTuple ltup,
IndexTuple rtup, GISTSTATE *giststate); IndexTuple rtup, GISTSTATE *giststate);
static void static void gistAdjustKeys(Relation r, GISTSTACK *stk, BlockNumber blk,
gistAdjustKeys(Relation r, GISTSTACK *stk, BlockNumber blk,
char *datum, int att_size, GISTSTATE *giststate); char *datum, int att_size, GISTSTATE *giststate);
static void static void gistintinsert(Relation r, GISTSTACK *stk, IndexTuple ltup,
gistintinsert(Relation r, GISTSTACK *stk, IndexTuple ltup,
IndexTuple rtup, GISTSTATE *giststate); IndexTuple rtup, GISTSTATE *giststate);
static InsertIndexResult static InsertIndexResult gistSplit(Relation r, Buffer buffer,
gistSplit(Relation r, Buffer buffer,
GISTSTACK *stack, IndexTuple itup, GISTSTACK *stack, IndexTuple itup,
GISTSTATE *giststate); GISTSTATE *giststate);
static void static void gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple lt,
gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple lt,
IndexTuple rt); IndexTuple rt);
static void GISTInitBuffer(Buffer b, uint32 f); static void GISTInitBuffer(Buffer b, uint32 f);
static BlockNumber static BlockNumber gistChooseSubtree(Relation r, IndexTuple itup, int level,
gistChooseSubtree(Relation r, IndexTuple itup, int level,
GISTSTATE *giststate, GISTSTATE *giststate,
GISTSTACK **retstack, Buffer *leafbuf); GISTSTACK **retstack, Buffer *leafbuf);
static OffsetNumber static OffsetNumber gistchoose(Relation r, Page p, IndexTuple it,
gistchoose(Relation r, Page p, IndexTuple it,
GISTSTATE *giststate); GISTSTATE *giststate);
static int gistnospace(Page p, IndexTuple it); static int gistnospace(Page p, IndexTuple it);
void gistdelete(Relation r, ItemPointer tid); void gistdelete(Relation r, ItemPointer tid);
static IndexTuple gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t); static IndexTuple gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t);
static void static void gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
Relation r, Page pg, OffsetNumber o, int b, bool l); Relation r, Page pg, OffsetNumber o, int b, bool l);
static char *int_range_out(INTRANGE *r); static char *int_range_out(INTRANGE *r);

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* This file contains only the public interface routines. * This file contains only the public interface routines.

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* These functions are stored in pg_amproc. For each operator class * These functions are stored in pg_amproc. For each operator class

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * INTERFACE ROUTINES
@@ -414,6 +414,7 @@ heapgettup(Relation relation,
if (ItemPointerGetBlockNumber(iptr) != page) if (ItemPointerGetBlockNumber(iptr) != page)
{ {
/* /*
* set block id to the correct page number --- this is * set block id to the correct page number --- this is
* a hack to support the virtual fragment concept * 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; return tuple;
} }
@@ -1206,9 +1208,10 @@ heap_delete(Relation relation, ItemPointer tid)
Assert(HeapTupleIsValid(tp)); Assert(HeapTupleIsValid(tp));
if (TupleUpdatedByCurXactAndCmd(tp)) if (TupleUpdatedByCurXactAndCmd(tp))
{ {
/* /*
Vadim says this is no longer needed 1998/6/15 * Vadim says this is no longer needed 1998/6/15 elog(NOTICE,
elog(NOTICE, "Non-functional delete, tuple already deleted"); * "Non-functional delete, tuple already deleted");
*/ */
if (IsSystemRelationName(RelationGetRelationName(relation)->data)) if (IsSystemRelationName(RelationGetRelationName(relation)->data))
RelationUnsetLockForWrite(relation); RelationUnsetLockForWrite(relation);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * INTERFACE ROUTINES
* index_open - open an index relation by relationId * index_open - open an index relation by relationId

View File

@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 #ifdef USE_ASSERT_CHECKING
static bool StrategyEvaluationIsValid(StrategyEvaluation evaluation); static bool StrategyEvaluationIsValid(StrategyEvaluation evaluation);
static bool static bool StrategyExpressionIsValid(StrategyExpression expression,
StrategyExpressionIsValid(StrategyExpression expression,
StrategyNumber maxStrategy); StrategyNumber maxStrategy);
static ScanKey StrategyMapGetScanKeyEntry(StrategyMap map, static ScanKey StrategyMapGetScanKeyEntry(StrategyMap map,
StrategyNumber strategyNumber); StrategyNumber strategyNumber);
static bool static bool StrategyOperatorIsValid(StrategyOperator operator,
StrategyOperatorIsValid(StrategyOperator operator,
StrategyNumber maxStrategy); StrategyNumber maxStrategy);
static bool static bool StrategyTermIsValid(StrategyTerm term,
StrategyTermIsValid(StrategyTerm term,
StrategyNumber maxStrategy); StrategyNumber maxStrategy);
#endif #endif
@@ -456,9 +453,7 @@ RelationInvokeStrategy(Relation relation,
} }
if (index == (*termP)->degree) if (index == (*termP)->degree)
{
return StrategyTermEvaluate(*termP, strategyMap, left, right); return StrategyTermEvaluate(*termP, strategyMap, left, right);
}
termP += 1; termP += 1;
} }

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* These functions are stored in pg_amproc. For each operator class * These functions are stored in pg_amproc. For each operator class
@@ -88,6 +88,7 @@ int32
btoid8cmp(Oid *a, Oid *b) btoid8cmp(Oid *a, Oid *b)
{ {
int i; int i;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
/* we use this because we need the int4gt, etc */ /* we use this because we need the int4gt, etc */
if (!int4eq(a[i], b[i])) if (!int4eq(a[i], b[i]))

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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 * NOTES
* This file contains only the public interface routines. * 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. * See comments in btbuild.
* *
* if (itup->t_info & INDEX_NULL_MASK) * if (itup->t_info & INDEX_NULL_MASK) return (InsertIndexResult) NULL;
return (InsertIndexResult) NULL;
*/ */
btitem = _bt_formitem(itup); btitem = _bt_formitem(itup);
@@ -397,16 +396,15 @@ btgettuple(IndexScanDesc scan, ScanDirection dir)
if (ItemPointerIsValid(&(scan->currentItemData))) if (ItemPointerIsValid(&(scan->currentItemData)))
{ {
/* /*
* Now we don't adjust scans on insertion (comments in * Now we don't adjust scans on insertion (comments in
* nbtscan.c:_bt_scandel()) and I hope that we will unlock * nbtscan.c:_bt_scandel()) and I hope that we will unlock current
* current index page before leaving index in LLL: this * index page before leaving index in LLL: this means that current
* means that current index tuple could be moved right * index tuple could be moved right before we get here and we have
* before we get here and we have to restore our scan * to restore our scan position. We save heap TID pointed by
* position. We save heap TID pointed by current index * current index tuple and use it. This will work untill we start
* tuple and use it. This will work untill we start * to re-use (move heap tuples) without vacuum... - vadim 07/29/98
* to re-use (move heap tuples) without vacuum...
* - vadim 07/29/98
*/ */
_bt_restscan(scan); _bt_restscan(scan);
res = _bt_next(scan, dir); res = _bt_next(scan, dir);
@@ -641,9 +639,10 @@ _bt_restscan(IndexScanDesc scan)
if (maxoff >= offnum) if (maxoff >= offnum)
{ {
/* /*
* if the item is where we left it or has just moved right * if the item is where we left it or has just moved right on this
* on this page, we're done * page, we're done
*/ */
for (; for (;
offnum <= maxoff; offnum <= maxoff;

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 #endif
static BTStack static BTStack _bt_searchr(Relation rel, int keysz, ScanKey scankey,
_bt_searchr(Relation rel, int keysz, ScanKey scankey,
Buffer *bufP, BTStack stack_in); Buffer *bufP, BTStack stack_in);
static OffsetNumber static OffsetNumber _bt_firsteq(Relation rel, TupleDesc itupdesc, Page page,
_bt_firsteq(Relation rel, TupleDesc itupdesc, Page page,
Size keysz, ScanKey scankey, OffsetNumber offnum); Size keysz, ScanKey scankey, OffsetNumber offnum);
static int static int _bt_compare(Relation rel, TupleDesc itupdesc, Page page,
_bt_compare(Relation rel, TupleDesc itupdesc, Page page,
int keysz, ScanKey scankey, OffsetNumber offnum); int keysz, ScanKey scankey, OffsetNumber offnum);
static bool static bool
_bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir); _bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir);

View File

@@ -5,7 +5,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* *

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 #endif
static OffsetNumber static OffsetNumber findnext(IndexScanDesc s, Page p, OffsetNumber n,
findnext(IndexScanDesc s, Page p, OffsetNumber n,
ScanDirection dir); ScanDirection dir);
static RetrieveIndexResult rtscancache(IndexScanDesc s, ScanDirection dir); static RetrieveIndexResult rtscancache(IndexScanDesc s, ScanDirection dir);
static RetrieveIndexResult rtfirst(IndexScanDesc s, ScanDirection dir); static RetrieveIndexResult rtfirst(IndexScanDesc s, ScanDirection dir);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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; } RTSTATE;
/* non-export function prototypes */ /* non-export function prototypes */
static InsertIndexResult static InsertIndexResult rtdoinsert(Relation r, IndexTuple itup,
rtdoinsert(Relation r, IndexTuple itup,
RTSTATE *rtstate); RTSTATE *rtstate);
static void static void rttighten(Relation r, RTSTACK *stk, char *datum, int att_size,
rttighten(Relation r, RTSTACK *stk, char *datum, int att_size,
RTSTATE *rtstate); RTSTATE *rtstate);
static InsertIndexResult static InsertIndexResult dosplit(Relation r, Buffer buffer, RTSTACK *stack,
dosplit(Relation r, Buffer buffer, RTSTACK *stack,
IndexTuple itup, RTSTATE *rtstate); IndexTuple itup, RTSTATE *rtstate);
static void static void rtintinsert(Relation r, RTSTACK *stk, IndexTuple ltup,
rtintinsert(Relation r, RTSTACK *stk, IndexTuple ltup,
IndexTuple rtup, RTSTATE *rtstate); IndexTuple rtup, RTSTATE *rtstate);
static void rtnewroot(Relation r, IndexTuple lt, IndexTuple rt); static void rtnewroot(Relation r, IndexTuple lt, IndexTuple rt);
static void static void picksplit(Relation r, Page page, SPLITVEC *v, IndexTuple itup,
picksplit(Relation r, Page page, SPLITVEC *v, IndexTuple itup,
RTSTATE *rtstate); RTSTATE *rtstate);
static void RTInitBuffer(Buffer b, uint32 f); static void RTInitBuffer(Buffer b, uint32 f);
static OffsetNumber static OffsetNumber choose(Relation r, Page p, IndexTuple it,
choose(Relation r, Page p, IndexTuple it,
RTSTATE *rtstate); RTSTATE *rtstate);
static int nospace(Page p, IndexTuple it); static int nospace(Page p, IndexTuple it);
static void initRtstate(RTSTATE *rtstate, Relation index); static void initRtstate(RTSTATE *rtstate, Relation index);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 */ /* routines defined and used here */
static void rtregscan(IndexScanDesc s); static void rtregscan(IndexScanDesc s);
static void rtdropscan(IndexScanDesc s); static void rtdropscan(IndexScanDesc s);
static void static void rtadjone(IndexScanDesc s, int op, BlockNumber blkno,
rtadjone(IndexScanDesc s, int op, BlockNumber blkno,
OffsetNumber offnum); OffsetNumber offnum);
static void static void adjuststack(RTSTACK *stk, BlockNumber blkno,
adjuststack(RTSTACK *stk, BlockNumber blkno,
OffsetNumber offnum); OffsetNumber offnum);
static void static void adjustiptr(IndexScanDesc s, ItemPointer iptr,
adjustiptr(IndexScanDesc s, ItemPointer iptr,
int op, BlockNumber blkno, OffsetNumber offnum); int op, BlockNumber blkno, OffsetNumber offnum);
/* /*

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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/rtree.h>
#include <access/istrat.h> #include <access/istrat.h>
static StrategyNumber static StrategyNumber RelationGetRTStrategy(Relation r,
RelationGetRTStrategy(Relation r,
AttrNumber attnum, RegProcedure proc); AttrNumber attnum, RegProcedure proc);
/* /*

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* This file contains the high level access-method interface to the * This file contains the high level access-method interface to the
@@ -29,8 +29,7 @@
static int RecoveryCheckingEnabled(void); static int RecoveryCheckingEnabled(void);
static void TransRecover(Relation logRelation); static void TransRecover(Relation logRelation);
static bool TransactionLogTest(TransactionId transactionId, XidStatus status); static bool TransactionLogTest(TransactionId transactionId, XidStatus status);
static void static void TransactionLogUpdate(TransactionId transactionId,
TransactionLogUpdate(TransactionId transactionId,
XidStatus status); XidStatus status);
/* ---------------- /* ----------------

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* This file contains support functions for the high * This file contains support functions for the high
@@ -23,11 +23,9 @@
#include <access/xact.h> #include <access/xact.h>
#include <storage/lmgr.h> #include <storage/lmgr.h>
static XidStatus static XidStatus TransBlockGetXidStatus(Block tblock,
TransBlockGetXidStatus(Block tblock,
TransactionId transactionId); TransactionId transactionId);
static void static void TransBlockSetXidStatus(Block tblock,
TransBlockSetXidStatus(Block tblock,
TransactionId transactionId, XidStatus xstatus); TransactionId transactionId, XidStatus xstatus);
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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 * NOTES
* Transaction aborts can now occur two ways: * Transaction aborts can now occur two ways:

View File

@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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; DataDir = optarg;
break; break;
case 'd': case 'd':
DebugMode = true; /* print out debugging info while parsing */ DebugMode = true; /* print out debugging info while
* parsing */
break; break;
case 'C': case 'C':
Noversion = true; Noversion = true;

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* See acl.h. * See acl.h.

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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 * INTERFACE ROUTINES
* heap_create() - Create an uncataloged heap relation * heap_create() - Create an uncataloged heap relation
@@ -65,8 +65,7 @@
#include <string.h> #include <string.h>
#endif #endif
static void static void AddPgRelationTuple(Relation pg_class_desc,
AddPgRelationTuple(Relation pg_class_desc,
Relation new_rel_desc, Oid new_rel_oid, unsigned natts, Relation new_rel_desc, Oid new_rel_oid, unsigned natts,
char relkind); char relkind);
static void AddToTempRelList(Relation r); static void AddToTempRelList(Relation r);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * INTERFACE ROUTINES
@@ -68,26 +68,22 @@ static Oid
RelationNameGetObjectId(char *relationName, Relation pg_class); RelationNameGetObjectId(char *relationName, Relation pg_class);
static Oid GetHeapRelationOid(char *heapRelationName, char *indexRelationName); static Oid GetHeapRelationOid(char *heapRelationName, char *indexRelationName);
static TupleDesc BuildFuncTupleDesc(FuncIndexInfo *funcInfo); static TupleDesc BuildFuncTupleDesc(FuncIndexInfo *funcInfo);
static TupleDesc static TupleDesc ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
List *attributeList, List *attributeList,
int numatts, AttrNumber *attNums); int numatts, AttrNumber *attNums);
static void ConstructIndexReldesc(Relation indexRelation, Oid amoid); static void ConstructIndexReldesc(Relation indexRelation, Oid amoid);
static Oid UpdateRelationRelation(Relation indexRelation); static Oid UpdateRelationRelation(Relation indexRelation);
static void static void InitializeAttributeOids(Relation indexRelation,
InitializeAttributeOids(Relation indexRelation,
int numatts, int numatts,
Oid indexoid); Oid indexoid);
static void static void
AppendAttributeTuples(Relation indexRelation, int numatts); AppendAttributeTuples(Relation indexRelation, int numatts);
static void static void UpdateIndexRelation(Oid indexoid, Oid heapoid,
UpdateIndexRelation(Oid indexoid, Oid heapoid,
FuncIndexInfo *funcInfo, int natts, FuncIndexInfo *funcInfo, int natts,
AttrNumber *attNums, Oid *classOids, Node *predicate, AttrNumber *attNums, Oid *classOids, Node *predicate,
List *attributeList, bool islossy, bool unique); List *attributeList, bool islossy, bool unique);
static void static void DefaultBuild(Relation heapRelation, Relation indexRelation,
DefaultBuild(Relation heapRelation, Relation indexRelation,
int numberOfAttributes, AttrNumber *attributeNumber, int numberOfAttributes, AttrNumber *attributeNumber,
IndexStrategy indexStrategy, uint16 parameterCount, IndexStrategy indexStrategy, uint16 parameterCount,
Datum *parameter, FuncIndexInfoPtr funcInfo, PredInfo *predInfo); Datum *parameter, FuncIndexInfoPtr funcInfo, PredInfo *predInfo);
@@ -614,7 +610,9 @@ static void
AppendAttributeTuples(Relation indexRelation, int numatts) AppendAttributeTuples(Relation indexRelation, int numatts)
{ {
Relation pg_attribute; Relation pg_attribute;
HeapTuple init_tuple, cur_tuple = NULL, new_tuple; HeapTuple init_tuple,
cur_tuple = NULL,
new_tuple;
bool hasind; bool hasind;
Relation idescs[Num_pg_attr_indices]; Relation idescs[Num_pg_attr_indices];

View File

@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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 * NOTES
* these routines moved here from commands/define.c and somewhat cleaned up. * these routines moved here from commands/define.c and somewhat cleaned up.
@@ -35,28 +35,23 @@
#include <string.h> #include <string.h>
#endif #endif
static Oid static Oid OperatorGetWithOpenRelation(Relation pg_operator_desc,
OperatorGetWithOpenRelation(Relation pg_operator_desc,
const char *operatorName, const char *operatorName,
Oid leftObjectId, Oid leftObjectId,
Oid rightObjectId); Oid rightObjectId);
static Oid static Oid OperatorGet(char *operatorName,
OperatorGet(char *operatorName,
char *leftTypeName, char *leftTypeName,
char *rightTypeName); char *rightTypeName);
static Oid static Oid OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
char *operatorName, char *operatorName,
Oid leftObjectId, Oid leftObjectId,
Oid rightObjectId); Oid rightObjectId);
static Oid static Oid OperatorShellMake(char *operatorName,
OperatorShellMake(char *operatorName,
char *leftTypeName, char *leftTypeName,
char *rightTypeName); char *rightTypeName);
static void static void OperatorDef(char *operatorName,
OperatorDef(char *operatorName,
int definedOK, int definedOK,
char *leftTypeName, char *leftTypeName,
char *rightTypeName, char *rightTypeName,

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 (!strcmp(languageName, "sql"))
{ {
/* /*
* If this call is defining a set, check if the set is already * If this call is defining a set, check if the set is already
* defined by looking to see whether this call's function text * defined by looking to see whether this call's function text

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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> #include <string.h>
#endif #endif
static Oid static Oid TypeShellMakeWithOpenRelation(Relation pg_type_desc,
TypeShellMakeWithOpenRelation(Relation pg_type_desc,
char *typeName); char *typeName);
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
@@ -534,7 +533,8 @@ TypeRename(char *oldTypeName, char *newTypeName)
{ {
Relation pg_type_desc; Relation pg_type_desc;
Relation idescs[Num_pg_type_indices]; Relation idescs[Num_pg_type_indices];
HeapTuple oldtup, newtup; HeapTuple oldtup,
newtup;
pg_type_desc = heap_openr(TypeRelationName); pg_type_desc = heap_openr(TypeRelationName);

View File

@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* At the point the version is defined, 2 physical relations are created * At the point the version is defined, 2 physical relations are created

View File

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

View File

@@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * 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\"", elog(ERROR, "cluster: unknown relation: \"%s\"",
oldrelname); 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 */ OldIndex = index_openr(oldindexname); /* Open old index relation */
if (!RelationIsValid(OldIndex)) if (!RelationIsValid(OldIndex))

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated * The PortalExecutorHeapMemory crap needs to be eliminated

View File

@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * 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 GetTypeElement(Oid type);
static Oid GetInputFunction(Oid type); static Oid GetInputFunction(Oid type);
static Oid IsTypeByVal(Oid type); static Oid IsTypeByVal(Oid type);
static void static void GetIndexRelations(Oid main_relation_oid,
GetIndexRelations(Oid main_relation_oid,
int *n_indices, int *n_indices,
Relation **index_rels); Relation **index_rels);
@@ -116,9 +115,9 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
int result; int result;
/* /*
* Close previous file opened for COPY but failed with elog(). * Close previous file opened for COPY but failed with elog(). There
* There should be a better way, but would not be modular. * should be a better way, but would not be modular. Prevents file
* Prevents file descriptor leak. bjm 1998/08/29 * descriptor leak. bjm 1998/08/29
*/ */
if (file_opened) if (file_opened)
FreeFile(fp); FreeFile(fp);
@@ -1022,11 +1021,13 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
char c; char c;
int done = 0; int done = 0;
int i = 0; int i = 0;
#ifdef MULTIBYTE #ifdef MULTIBYTE
int mblen; int mblen;
int encoding; int encoding;
unsigned char s[2]; unsigned char s[2];
int j; int j;
#endif #endif
#ifdef MULTIBYTE #ifdef MULTIBYTE
@@ -1139,7 +1140,8 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
s[0] = c; s[0] = c;
mblen = pg_encoding_mblen(encoding, s); mblen = pg_encoding_mblen(encoding, s);
mblen--; mblen--;
for(j=0;j<mblen;j++) { for (j = 0; j < mblen; j++)
{
c = getc(fp); c = getc(fp);
if (feof(fp)) if (feof(fp))
return NULL; return NULL;
@@ -1167,6 +1169,7 @@ CopyAttributeOut(FILE *fp, char *server_string, char *delim, int is_array)
int mblen; int mblen;
int encoding; int encoding;
int i; int i;
#endif #endif
#ifdef MULTIBYTE #ifdef MULTIBYTE
@@ -1204,9 +1207,8 @@ CopyAttributeOut(FILE *fp, char *server_string, char *delim, int is_array)
} }
} }
#ifdef MULTIBYTE #ifdef MULTIBYTE
for (i=0;i<mblen;i++) { for (i = 0; i < mblen; i++)
fputc(*(string + i), fp); fputc(*(string + i), fp);
}
#else #else
fputc(*string, fp); fputc(*string, fp);
#endif #endif

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 static int checkAttrExists(char *attributeName,
checkAttrExists(char *attributeName,
char *attributeType, List *schema); char *attributeType, List *schema);
static List *MergeAttributes(List *schema, List *supers, List **supconstr); static List *MergeAttributes(List *schema, List *supers, List **supconstr);
static void StoreCatalogInheritance(Oid relationId, List *supers); static void StoreCatalogInheritance(Oid relationId, List *supers);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 */ /* non-export function prototypes */
static void static void check_permissions(char *command, char *dbpath, char *dbname,
check_permissions(char *command, char *dbpath, char *dbname,
Oid *dbIdP, int4 *userIdP); Oid *dbIdP, int4 *userIdP);
static HeapTuple get_pg_dbtup(char *command, char *dbname, Relation dbrel); static HeapTuple get_pg_dbtup(char *command, char *dbname, Relation dbrel);
static void stop_vacuum(char *dbpath, char *dbname); static void stop_vacuum(char *dbpath, char *dbname);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 */ /* non-export function prototypes */
static void CheckPredicate(List *predList, List *rangeTable, Oid baseRelOid); static void CheckPredicate(List *predList, List *rangeTable, Oid baseRelOid);
static void static void CheckPredExpr(Node *predicate, List *rangeTable,
CheckPredExpr(Node *predicate, List *rangeTable,
Oid baseRelOid); Oid baseRelOid);
static void static void
CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid); CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid);
static void static void FuncIndexArgs(IndexElem *funcIndex, AttrNumber *attNumP,
FuncIndexArgs(IndexElem *funcIndex, AttrNumber *attNumP,
Oid *argTypes, Oid *opOidP, Oid relId); Oid *argTypes, Oid *opOidP, Oid relId);
static void static void NormIndexAttrs(List *attList, AttrNumber *attNumP,
NormIndexAttrs(List *attList, AttrNumber *attNumP,
Oid *opOidP, Oid relId); Oid *opOidP, Oid relId);
static char *GetDefaultOpClass(Oid atttypid); static char *GetDefaultOpClass(Oid atttypid);
@@ -468,7 +465,8 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
Oid relId) Oid relId)
{ {
List *rest; List *rest;
HeapTuple atttuple, tuple; HeapTuple atttuple,
tuple;
/* /*
* process attributeList * process attributeList

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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); QueryTreeList *appendQlist(QueryTreeList *q1, QueryTreeList *q2);
void OffsetVarAttno(Node *node, int varno, int offset); void OffsetVarAttno(Node *node, int varno, int offset);
static void static void appendTeeQuery(TeeInfo * teeInfo,
appendTeeQuery(TeeInfo * teeInfo,
QueryTreeList *q, QueryTreeList *q,
char *teeNodeName); char *teeNodeName);
static Plan * static Plan *replaceTeeScans(Plan *plan,
replaceTeeScans(Plan *plan,
Query *parsetree, Query *parsetree,
TeeInfo * teeInfo); TeeInfo * teeInfo);
static void static void replaceSeqScan(Plan *plan,
replaceSeqScan(Plan *plan,
Plan *parent, Plan *parent,
int rt_ind, int rt_ind,
Plan *tplan); Plan *tplan);
static void static void tg_rewriteQuery(TgRecipe * r, TgNode * n,
tg_rewriteQuery(TgRecipe * r, TgNode * n,
QueryTreeList *q, QueryTreeList *q,
QueryTreeList *inputQlist); QueryTreeList *inputQlist);
static Node * static Node *tg_replaceNumberedParam(Node *expression,
tg_replaceNumberedParam(Node *expression,
int pnum, int pnum,
int rt_ind, int rt_ind,
char *teeRelName); char *teeRelName);
static Node * static Node *tg_rewriteParamsInExpr(Node *expression,
tg_rewriteParamsInExpr(Node *expression,
QueryTreeList *inputQlist); QueryTreeList *inputQlist);
static QueryTreeList * static QueryTreeList *tg_parseSubQuery(TgRecipe * r,
tg_parseSubQuery(TgRecipe * r,
TgNode * n, TgNode * n,
TeeInfo * teeInfo); TeeInfo * teeInfo);
static QueryTreeList * static QueryTreeList *tg_parseTeeNode(TgRecipe * r,
tg_parseTeeNode(TgRecipe * r,
TgNode * n, TgNode * n,
int i, int i,
QueryTreeList *qList, QueryTreeList *qList,

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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); 0, 0, 0);
if (!HeapTupleIsValid(reltup)) if (!HeapTupleIsValid(reltup))
{
elog(ERROR, "renameatt: unknown relation: \"%s\"", relname); elog(ERROR, "renameatt: unknown relation: \"%s\"", relname);
}
myrelid = reltup->t_oid; myrelid = reltup->t_oid;

View File

@@ -330,14 +330,17 @@ setval(struct varlena * seqin, int4 next)
/* open and WIntentLock sequence */ /* open and WIntentLock sequence */
elm = init_sequence("setval", seqname); elm = init_sequence("setval", seqname);
seq = read_info ("setval", elm, &buf); /* lock page and read tuple */ seq = read_info("setval", elm, &buf); /* lock page and read
* tuple */
if ( seq->cache_value != 1 ) { if (seq->cache_value != 1)
{
elog(ERROR, "%s.setval: can't set value of sequence %s, cache != 1", elog(ERROR, "%s.setval: can't set value of sequence %s, cache != 1",
seqname, seqname); seqname, seqname);
} }
if ((next < seq->min_value) || (next > seq->max_value)) { if ((next < seq->min_value) || (next > seq->max_value))
{
elog(ERROR, "%s.setval: value %d is of of bounds (%d,%d)", elog(ERROR, "%s.setval: value %d is of of bounds (%d,%d)",
seqname, next, seq->min_value, seq->max_value); seqname, next, seq->min_value, seq->max_value);
} }

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) if (Irel != (Relation *) NULL)
vc_clsindices(nindices, Irel); 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); 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; 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 * Try to make fraged_pages keeping in mind that we can't use free
* "empty" end-pages and last page if it reapped. * space of "empty" end-pages and last page if it reapped.
*/ */
if (do_shrinking && vacuum_pages->vpl_num_pages - empty_end_pages > 0) 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 */ /* get prev reapped page from vacuum_pages */
last_vacuum_page = vacuum_pages->vpl_pagedesc[vacuumed_pages - 1]; last_vacuum_page = vacuum_pages->vpl_pagedesc[vacuumed_pages - 1];
last_vacuum_block = last_vacuum_page->vpd_blkno; 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; --num_fraged_pages;
Assert(num_fraged_pages > 0); 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 * Clean uncleaned reapped pages from vacuum_pages list and set xmin
* for inserted tuples * committed for inserted tuples
*/ */
checked_moved = 0; checked_moved = 0;
for (i = 0, vpp = vacuum_pages->vpl_pagedesc; i < vacuumed_pages; i++, vpp++) 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; int i;
nblocks = vacuum_pages->vpl_num_pages; 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++) 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); nblocks = smgrtruncate(DEFAULT_SMGR, onerel, nblocks);
Assert(nblocks >= 0); Assert(nblocks >= 0);
vacrelstats->num_pages = nblocks; /* set new number of blocks */ vacrelstats->num_pages = nblocks; /* set new number of
* blocks */
} }
} /* vc_vacheap */ } /* vc_vacheap */
@@ -2216,7 +2220,11 @@ vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc)
ObjectIdGetDatum(RelationGetRelid(Irel[i])), ObjectIdGetDatum(RelationGetRelid(Irel[i])),
0, 0, 0); 0, 0, 0);
Assert(cachetuple); 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); idcur->tform = (Form_pg_index) GETSTRUCT(cachetuple);
for (attnumP = &(idcur->tform->indkey[0]), natts = 0; for (attnumP = &(idcur->tform->indkey[0]), natts = 0;
*attnumP != InvalidAttrNumber && natts != INDEX_MAX_KEYS; *attnumP != InvalidAttrNumber && natts != INDEX_MAX_KEYS;
@@ -2247,7 +2255,8 @@ vc_enough_space(VPageDescr vpd, Size len)
if (len > vpd->vpd_free) if (len > vpd->vpd_free)
return false; 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 */ return true; /* and len <= free_space */
/* ok. noff_usd >= noff_free and so we'll have to allocate new itemid */ /* 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', * Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements. * '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 * 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 * 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 "access/heapam.h"
#include "catalog/heap.h" #include "catalog/heap.h"
static Pointer static Pointer ExecBeginScan(Relation relation, int nkeys, ScanKey skeys,
ExecBeginScan(Relation relation, int nkeys, ScanKey skeys,
bool isindex, ScanDirection dir, Snapshot snapshot); bool isindex, ScanDirection dir, Snapshot snapshot);
static Relation ExecOpenR(Oid relationOid, bool isindex); static Relation ExecOpenR(Oid relationOid, bool isindex);

View File

@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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" #include "executor/execFlatten.h"
#ifdef SETS_FIXED #ifdef SETS_FIXED
static bool static bool FjoinBumpOuterNodes(TargetEntry *tlist, ExprContext *econtext,
FjoinBumpOuterNodes(TargetEntry *tlist, ExprContext *econtext,
DatumPtr results, char *nulls); DatumPtr results, char *nulls);
#endif #endif

View File

@@ -26,7 +26,7 @@
* *
* *
* IDENTIFICATION * 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 "catalog/heap.h"
#include "commands/trigger.h" #include "commands/trigger.h"
void void ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
Query *parseTree); Query *parseTree);
/* decls for local routines only used within this module */ /* decls for local routines only used within this module */
static TupleDesc static TupleDesc InitPlan(CmdType operation, Query *parseTree,
InitPlan(CmdType operation, Query *parseTree,
Plan *plan, EState *estate); Plan *plan, EState *estate);
static void EndPlan(Plan *plan, EState *estate); static void EndPlan(Plan *plan, EState *estate);
static TupleTableSlot * static TupleTableSlot *ExecutePlan(EState *estate, Plan *plan,
ExecutePlan(EState *estate, Plan *plan,
Query *parseTree, CmdType operation, Query *parseTree, CmdType operation,
int numberTuples, ScanDirection direction, int numberTuples, ScanDirection direction,
void (*printfunc) ()); void (*printfunc) ());
static void ExecRetrieve(TupleTableSlot *slot, void (*printfunc) (), static void ExecRetrieve(TupleTableSlot *slot, void (*printfunc) (),
EState *estate); EState *estate);
static void static void ExecAppend(TupleTableSlot *slot, ItemPointer tupleid,
ExecAppend(TupleTableSlot *slot, ItemPointer tupleid,
EState *estate); EState *estate);
static void static void ExecDelete(TupleTableSlot *slot, ItemPointer tupleid,
ExecDelete(TupleTableSlot *slot, ItemPointer tupleid,
EState *estate); EState *estate);
static void static void ExecReplace(TupleTableSlot *slot, ItemPointer tupleid,
ExecReplace(TupleTableSlot *slot, ItemPointer tupleid,
EState *estate, Query *parseTree); EState *estate, Query *parseTree);
/* end of local decls */ /* end of local decls */
@@ -547,6 +541,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
(operation == CMD_SELECT && junk_filter_needed)) (operation == CMD_SELECT && junk_filter_needed))
{ {
JunkFilter *j = (JunkFilter *) ExecInitJunkFilter(targetList); JunkFilter *j = (JunkFilter *) ExecInitJunkFilter(targetList);
estate->es_junkFilter = j; estate->es_junkFilter = j;
if (operation == CMD_SELECT) if (operation == CMD_SELECT)

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 functions decls */
static Datum ExecEvalAggreg(Aggreg *agg, ExprContext *econtext, bool *isNull); static Datum ExecEvalAggreg(Aggreg *agg, ExprContext *econtext, bool *isNull);
static Datum static Datum ExecEvalArrayRef(ArrayRef *arrayRef, ExprContext *econtext,
ExecEvalArrayRef(ArrayRef *arrayRef, ExprContext *econtext,
bool *isNull, bool *isDone); bool *isNull, bool *isDone);
static Datum ExecEvalAnd(Expr *andExpr, ExprContext *econtext, bool *isNull); static Datum ExecEvalAnd(Expr *andExpr, ExprContext *econtext, bool *isNull);
static Datum static Datum ExecEvalFunc(Expr *funcClause, ExprContext *econtext,
ExecEvalFunc(Expr *funcClause, ExprContext *econtext,
bool *isNull, bool *isDone); bool *isNull, bool *isDone);
static void static void ExecEvalFuncArgs(FunctionCachePtr fcache, ExprContext *econtext,
ExecEvalFuncArgs(FunctionCachePtr fcache, ExprContext *econtext,
List *argList, Datum argV[], bool *argIsDone); List *argList, Datum argV[], bool *argIsDone);
static Datum ExecEvalNot(Expr *notclause, ExprContext *econtext, bool *isNull); static Datum ExecEvalNot(Expr *notclause, ExprContext *econtext, bool *isNull);
static Datum static Datum ExecEvalOper(Expr *opClause, ExprContext *econtext,
ExecEvalOper(Expr *opClause, ExprContext *econtext,
bool *isNull); bool *isNull);
static Datum ExecEvalOr(Expr *orExpr, ExprContext *econtext, bool *isNull); static Datum ExecEvalOr(Expr *orExpr, ExprContext *econtext, bool *isNull);
static Datum ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull); static Datum ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull);
static Datum static Datum ExecMakeFunctionResult(Node *node, List *arguments,
ExecMakeFunctionResult(Node *node, List *arguments,
ExprContext *econtext, bool *isNull, bool *isDone); ExprContext *econtext, bool *isNull, bool *isDone);
static bool ExecQualClause(Node *clause, ExprContext *econtext); static bool ExecQualClause(Node *clause, ExprContext *econtext);

View File

@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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/lsyscache.h"
#include "utils/mcxt.h" #include "utils/mcxt.h"
static void static void ExecGetIndexKeyInfo(Form_pg_index indexTuple, int *numAttsOutP,
ExecGetIndexKeyInfo(Form_pg_index indexTuple, int *numAttsOutP,
AttrNumber **attsOutP, FuncIndexInfoPtr fInfoP); AttrNumber **attsOutP, FuncIndexInfoPtr fInfoP);
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------

View File

@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 */ /* non-export function prototypes */
static TupleDesc postquel_start(execution_state *es); static TupleDesc postquel_start(execution_state *es);
static execution_state * static execution_state *init_execution_state(FunctionCachePtr fcache,
init_execution_state(FunctionCachePtr fcache,
char *args[]); char *args[]);
static TupleTableSlot *postquel_getnext(execution_state *es); static TupleTableSlot *postquel_getnext(execution_state *es);
static void postquel_end(execution_state *es); static void postquel_end(execution_state *es);
static void static void postquel_sub_params(execution_state *es, int nargs,
postquel_sub_params(execution_state *es, int nargs,
char *args[], bool *nullV); char *args[], bool *nullV);
static Datum static Datum postquel_execute(execution_state *es, FunctionCachePtr fcache,
postquel_execute(execution_state *es, FunctionCachePtr fcache,
List *fTlist, char **args, bool *isNull); 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; aggstate = node->aggstate;
if (aggstate->agg_done) if (aggstate->agg_done)
@@ -255,10 +259,10 @@ ExecAgg(Agg *node)
{ {
/* /*
* when the outerplan doesn't return a single tuple, create a * when the outerplan doesn't return a single tuple,
* dummy heaptuple anyway because we still need to return a * create a dummy heaptuple anyway because we still need
* valid aggregate value. The value returned will be the * to return a valid aggregate value. The value returned
* initial values of the transition functions * will be the initial values of the transition functions
*/ */
if (nTuplesAgged == 0) if (nTuplesAgged == 0)
{ {
@@ -322,15 +326,16 @@ ExecAgg(Agg *node)
int byVal = 0; int byVal = 0;
/* /*
* value1 and value2 has not been initialized. This is * value1 and value2 has not been initialized.
* the first non-NULL value. We use it as the initial * This is the first non-NULL value. We use it as
* value. * the initial value.
*/ */
/* /*
* but we can't just use it straight, we have to make * but we can't just use it straight, we have to
* a copy of it since the tuple from which it came * make a copy of it since the tuple from which it
* will be freed on the next iteration of the scan * came will be freed on the next iteration of the
* scan
*/ */
switch (nodeTag(aggregates[i]->target)) switch (nodeTag(aggregates[i]->target))
{ {
@@ -402,8 +407,9 @@ ExecAgg(Agg *node)
} }
/* /*
* keep this for the projection (we only need one of these - all * keep this for the projection (we only need one of these -
* the tuples we aggregate over share the same group column) * all the tuples we aggregate over share the same group
* column)
*/ */
if (!oneTuple) if (!oneTuple)
oneTuple = heap_copytuple(outerslot->val); oneTuple = heap_copytuple(outerslot->val);
@@ -424,8 +430,9 @@ ExecAgg(Agg *node)
{ {
/* /*
* No values found for this agg; return current state. This * No values found for this agg; return current state.
* seems to fix behavior for avg() aggregate. -tgl 12/96 * This seems to fix behavior for avg() aggregate. -tgl
* 12/96
*/ */
} }
else if (aggfns->finalfn.fn_addr != NULL && nTuplesAgged > 0) 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, * value in the right place, ignore. (If you remove this
* fix the else part. -ay 2/95) * case, fix the else part. -ay 2/95)
*/ */
} }
else if (aggfns->xfn2.fn_addr != NULL) else if (aggfns->xfn2.fn_addr != NULL)
@@ -484,8 +491,10 @@ ExecAgg(Agg *node)
resultSlot = ExecProject(projInfo, &isDone); resultSlot = ExecProject(projInfo, &isDone);
/* As long as the retrieved group does not match the qualifications it is ignored and /*
* the next group is fetched */ * 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); qual_result = ExecQual(fix_opids(node->plan.qual), econtext);
if (oneTuple) if (oneTuple)
pfree(oneTuple); pfree(oneTuple);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive) * columns. (ie. tuples from the same group are consecutive)
* *
* IDENTIFICATION * 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 *ExecGroupEveryTuple(Group *node);
static TupleTableSlot *ExecGroupOneTuple(Group *node); static TupleTableSlot *ExecGroupOneTuple(Group *node);
static bool static bool sameGroup(HeapTuple oldslot, HeapTuple newslot,
sameGroup(HeapTuple oldslot, HeapTuple newslot,
int numCols, AttrNumber *grpColIdx, TupleDesc tupdesc); int numCols, AttrNumber *grpColIdx, TupleDesc tupdesc);
/* --------------------------------------- /* ---------------------------------------

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 hashFunc(char *key, int len);
static int ExecHashPartition(Hash *node); static int ExecHashPartition(Hash *node);
static RelativeAddr hashTableAlloc(int size, HashJoinTable hashtable); static RelativeAddr hashTableAlloc(int size, HashJoinTable hashtable);
static void static void ExecHashOverflowInsert(HashJoinTable hashtable,
ExecHashOverflowInsert(HashJoinTable hashtable,
HashBucket bucket, HashBucket bucket,
HeapTuple heapTuple); HeapTuple heapTuple);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * static TupleTableSlot *
ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate); ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate);
static TupleTableSlot * static TupleTableSlot *ExecHashJoinGetSavedTuple(HashJoinState *hjstate, char *buffer,
ExecHashJoinGetSavedTuple(HashJoinState *hjstate, char *buffer,
File file, TupleTableSlot *tupleSlot, int *block, char **position); File file, TupleTableSlot *tupleSlot, int *block, char **position);
static int static int ExecHashJoinGetBatch(int bucketno, HashJoinTable hashtable,
ExecHashJoinGetBatch(int bucketno, HashJoinTable hashtable,
int nbatch); int nbatch);
static int ExecHashJoinNewBatch(HashJoinState *hjstate); static int ExecHashJoinNewBatch(HashJoinState *hjstate);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 */ false); /* don't pfree */
/* /*
* We must check to see if the current tuple would have been * We must check to see if the current tuple would have
* matched by an earlier index, so we don't double report it. * been matched by an earlier index, so we don't double
* We do this by passing the tuple through ExecQual and look * report it. We do this by passing the tuple through
* for failure with all previous qualifications. * ExecQual and look for failure with all previous
* qualifications.
*/ */
for (prev_index = 0; prev_index < indexstate->iss_IndexPtr; for (prev_index = 0; prev_index < indexstate->iss_IndexPtr;
prev_index++) prev_index++)
@@ -268,8 +269,7 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
exprCtxt->ecxt_outertuple; exprCtxt->ecxt_outertuple;
/* /*
* get the index qualifications and recalculate the appropriate * get the index qualifications and recalculate the appropriate values
* values
*/ */
for (i = 0; i < numIndices; i++) for (i = 0; i < numIndices; i++)
{ {
@@ -282,10 +282,12 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
run_keys = (int *) runtimeKeyInfo[i]; run_keys = (int *) runtimeKeyInfo[i];
for (j = 0; j < n_keys; j++) for (j = 0; j < n_keys; j++)
{ {
/* /*
* If we have a run-time key, then extract the run-time * If we have a run-time key, then extract the run-time
* expression and evaluate it with respect to the current * 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) if (run_keys[j] != NO_OP)
{ {
@@ -994,8 +996,8 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
indexstate->cstate.cs_TupFromTlist = false; indexstate->cstate.cs_TupFromTlist = false;
/* /*
* if there are some PARAM_EXEC in skankeys then * if there are some PARAM_EXEC in skankeys then force index rescan on
* force index rescan on first scan. * first scan.
*/ */
((Plan *) node)->chgParam = execParam; ((Plan *) node)->chgParam = execParam;

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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 * means that this is the first time ExecMergeJoin() has
* been called and so we have to initialize the inner, * been called and so we have to initialize the inner,
* outer and marked tuples as well as various stuff in the * outer and marked tuples as well as various stuff in the
* expression context. * expression context. ********************************
* ******************************** *
*/ */
case EXEC_MJ_INITIALIZE: case EXEC_MJ_INITIALIZE:
MJ_printf("ExecMergeJoin: EXEC_MJ_INITIALIZE\n"); MJ_printf("ExecMergeJoin: EXEC_MJ_INITIALIZE\n");
@@ -526,8 +526,8 @@ ExecMergeJoin(MergeJoin *node)
* ******************************** EXEC_MJ_JOINMARK means * ******************************** EXEC_MJ_JOINMARK means
* we have just found a new outer tuple and a possible * we have just found a new outer tuple and a possible
* matching inner tuple. This is the case after the * matching inner tuple. This is the case after the
* INITIALIZE, SKIPOUTER or SKIPINNER states. * INITIALIZE, SKIPOUTER or SKIPINNER states. ********************************
* ******************************** *
*/ */
case EXEC_MJ_JOINMARK: case EXEC_MJ_JOINMARK:
MJ_printf("ExecMergeJoin: EXEC_MJ_JOINMARK\n"); MJ_printf("ExecMergeJoin: EXEC_MJ_JOINMARK\n");
@@ -655,8 +655,8 @@ ExecMergeJoin(MergeJoin *node)
break; break;
/* /*
* ******************************** EXEC_MJ_TESTOUTER * ******************************** EXEC_MJ_TESTOUTER If
* If the new outer tuple and the marked tuple satisify the * the new outer tuple and the marked tuple satisify the
* merge clause then we know we have duplicates in the * merge clause then we know we have duplicates in the
* outer scan so we have to restore the inner scan to the * outer scan so we have to restore the inner scan to the
* marked tuple and proceed to join the new outer tuples * marked tuple and proceed to join the new outer tuples
@@ -680,7 +680,9 @@ ExecMergeJoin(MergeJoin *node)
* *
* new outer tuple > marked tuple * new outer tuple > marked tuple
* *
* **************************** ***************************
*
*
*/ */
case EXEC_MJ_TESTOUTER: case EXEC_MJ_TESTOUTER:
MJ_printf("ExecMergeJoin: EXEC_MJ_TESTOUTER\n"); MJ_printf("ExecMergeJoin: EXEC_MJ_TESTOUTER\n");
@@ -698,13 +700,14 @@ ExecMergeJoin(MergeJoin *node)
if (qualResult) if (qualResult)
{ {
/* /*
* the merge clause matched so now we juggle the slots * the merge clause matched so now we juggle the slots
* back the way they were and proceed to JOINTEST. * back the way they were and proceed to JOINTEST.
* *
* I can't understand why we have to go to JOINTEST * I can't understand why we have to go to JOINTEST and
* and compare outer tuple with the same inner one * compare outer tuple with the same inner one again
* again -> go to JOINTUPLES... - vadim 02/27/98 * -> go to JOINTUPLES... - vadim 02/27/98
*/ */
ExecRestrPos(innerPlan); ExecRestrPos(innerPlan);
@@ -756,7 +759,9 @@ ExecMergeJoin(MergeJoin *node)
* we have to advance the outer scan until we find the outer * we have to advance the outer scan until we find the outer
* 8. * 8.
* *
**************************** **************************
*
*
* *
* *
* *
@@ -856,7 +861,9 @@ ExecMergeJoin(MergeJoin *node)
* we have to advance the inner scan until we find the inner * we have to advance the inner scan until we find the inner
* 12. * 12.
* *
**************************** **************************
*
*
* *
* *
* *
@@ -1189,8 +1196,8 @@ ExecReScanMergeJoin(MergeJoin *node, ExprContext *exprCtxt, Plan *parent)
mergestate->mj_JoinState = EXEC_MJ_INITIALIZE; mergestate->mj_JoinState = EXEC_MJ_INITIALIZE;
/* /*
* if chgParam of subnodes is not null then plans will be re-scanned by * if chgParam of subnodes is not null then plans will be re-scanned
* first ExecProcNode. * by first ExecProcNode.
*/ */
if (((Plan *) node)->lefttree->chgParam == NULL) if (((Plan *) node)->lefttree->chgParam == NULL)
ExecReScan(((Plan *) node)->lefttree, exprCtxt, (Plan *) node); ExecReScan(((Plan *) node)->lefttree, exprCtxt, (Plan *) node);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 "access/heapam.h"
#include "parser/parsetree.h" #include "parser/parsetree.h"
static Oid static Oid InitScanRelation(SeqScan *node, EState *estate,
InitScanRelation(SeqScan *node, EState *estate,
CommonScanState *scanstate, Plan *outerPlan); CommonScanState *scanstate, Plan *outerPlan);
static TupleTableSlot *SeqNext(SeqScan *node); static TupleTableSlot *SeqNext(SeqScan *node);
@@ -83,7 +82,8 @@ SeqNext(SeqScan *node)
slot = ExecStoreTuple(tuple,/* tuple to store */ slot = ExecStoreTuple(tuple,/* tuple to store */
slot, /* slot to store in */ 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 */ false); /* don't pfree this pointer */
/* ---------------- /* ----------------

View File

@@ -15,7 +15,7 @@
* ExecEndTee * ExecEndTee
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

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

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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 * NOTES
* This should be moved to a more appropriate place. It is here * 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++) 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); MemoryContextSwitchTo(currentContext);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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'; int c = '\0';
#ifdef MULTIBYTE #ifdef MULTIBYTE
unsigned char *p, *ps; unsigned char *p,
*ps;
int len; int len;
ps = s; ps = s;
@@ -203,7 +204,8 @@ pq_getstr(char *s, int maxlen)
#ifdef MULTIBYTE #ifdef MULTIBYTE
p = pg_client_to_server(ps, len); 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); strcpy(ps, p);
} }
#endif #endif
@@ -555,16 +557,18 @@ StreamServerPort(char *hostName, short portName, int *fdP)
strcpy(sock_path, saddr.un.sun_path); strcpy(sock_path, saddr.un.sun_path);
/* /*
* If the socket exists but nobody has an advisory lock on it * If the socket exists but nobody has an advisory lock on it we
* we can safely delete the file. * can safely delete the file.
*/ */
if ((lock_fd = open(sock_path, O_RDONLY|O_NONBLOCK, 0666)) >= 0) { if ((lock_fd = open(sock_path, O_RDONLY | O_NONBLOCK, 0666)) >= 0)
if (flock(lock_fd, LOCK_EX|LOCK_NB) == 0) { {
if (flock(lock_fd, LOCK_EX | LOCK_NB) == 0)
{
TPRINTF(TRACE_VERBOSE, "flock on %s, deleting", sock_path); TPRINTF(TRACE_VERBOSE, "flock on %s, deleting", sock_path);
unlink(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); close(lock_fd);
} }
} }
@@ -593,19 +597,20 @@ StreamServerPort(char *hostName, short portName, int *fdP)
return STATUS_ERROR; return STATUS_ERROR;
} }
if (family == AF_UNIX) { if (family == AF_UNIX)
{
on_proc_exit(StreamDoUnlink, NULL); on_proc_exit(StreamDoUnlink, NULL);
/* /*
* Open the socket file and get an advisory lock on it. * Open the socket file and get an advisory lock on it. The
* The lock_fd is left open to keep the lock. * lock_fd is left open to keep the lock.
*/ */
if ((lock_fd = open(sock_path, O_RDONLY|O_NONBLOCK, 0666)) >= 0) { if ((lock_fd = open(sock_path, O_RDONLY | O_NONBLOCK, 0666)) >= 0)
if (flock(lock_fd, LOCK_EX|LOCK_NB) != 0) { {
if (flock(lock_fd, LOCK_EX | LOCK_NB) != 0)
TPRINTF(TRACE_VERBOSE, "flock error for %s", sock_path); TPRINTF(TRACE_VERBOSE, "flock error for %s", sock_path);
} }
} }
}
listen(fd, SOMAXCONN); listen(fd, SOMAXCONN);
@@ -783,4 +788,5 @@ pq_putncharlen(char *s, int n)
pq_putint(len, sizeof(int)); pq_putint(len, sizeof(int));
pq_putnchar(p, len); pq_putnchar(p, len);
} }
#endif #endif

View File

@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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. * 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->len = (PacketLen) nbytes;
pkt->nrtodo = nbytes; pkt->nrtodo = nbytes;

View File

@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* This shouldn't be in libpq, but the monitor and some other * This shouldn't be in libpq, but the monitor and some other

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* XXX a few of the following functions are duplicated to handle * XXX a few of the following functions are duplicated to handle

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which * Every (plan) node in POSTGRES has an associated "out" routine which
@@ -129,6 +129,7 @@ _outFuncCall(StringInfo str, FuncCall *node)
appendStringInfo(str, " :args "); appendStringInfo(str, " :args ");
_outNode(str, node->args); _outNode(str, node->args);
} }
#endif #endif
static void static void
@@ -660,7 +661,8 @@ _outResdom(StringInfo str, Resdom *node)
sprintf(buf, " :restypmod %d ", node->restypmod); sprintf(buf, " :restypmod %d ", node->restypmod);
appendStringInfo(str, buf); appendStringInfo(str, buf);
appendStringInfo(str, " :resname "); 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); appendStringInfo(str, buf);
sprintf(buf, " :reskey %d ", node->reskey); sprintf(buf, " :reskey %d ", node->reskey);
appendStringInfo(str, buf); appendStringInfo(str, buf);

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
@@ -398,7 +398,10 @@ print_plan_recursive(Plan *p, Query *parsetree, int indentLevel, char *label)
{ {
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: "); print_plan_recursive(subnode, parsetree, indentLevel + 3, "a: ");
whichplan++; whichplan++;

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* Most of the read functions for plan nodes are tested. (In fact, they * Most of the read functions for plan nodes are tested. (In fact, they

View File

@@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -477,8 +477,8 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
*/ */
/* /*
* ! BUG BUG ! Relid relid = (Relid)lfirst(xrelid); RelOptInfo *rel = * ! BUG BUG ! Relid relid = (Relid)lfirst(xrelid); RelOptInfo
* get_join_rel(root, relid); * *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 * ! BUG BUG ! Relid relid = (Relid)lfirst(xrelid);
* *rel = get_join_rel(root, relid); * RelOptInfo *rel = get_join_rel(root, relid);
*/ */
/* /*

View File

@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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 * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 void find_rel_paths(Query *root, List *rels);
static List *find_join_paths(Query *root, List *outer_rels, int levels_needed); static List *find_join_paths(Query *root, List *outer_rels, int levels_needed);
#ifdef OPTIMIZER_DEBUG #ifdef OPTIMIZER_DEBUG
static void debug_print_rel(Query *root, RelOptInfo * rel); static void debug_print_rel(Query *root, RelOptInfo * rel);
#endif #endif
/* /*
@@ -76,6 +78,7 @@ find_paths(Query *root, List *rels)
if (levels_needed <= 1) if (levels_needed <= 1)
{ {
/* /*
* Unsorted single relation, no more processing is required. * Unsorted single relation, no more processing is required.
*/ */
@@ -83,6 +86,7 @@ find_paths(Query *root, List *rels)
} }
else else
{ {
/* /*
* this means that joins or sorts are required. set selectivities * this means that joins or sorts are required. set selectivities
* of clauses that have not been set by an index. * 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_) 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 * * rest will be deprecated in case of GEQO *

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -182,10 +182,8 @@ compute_clause_selec(Query *root, Node *clause, List *or_selectivities)
return compute_selec(root, ((Expr *) clause)->args, or_selectivities); return compute_selec(root, ((Expr *) clause)->args, or_selectivities);
} }
else else
{
return compute_selec(root, lcons(clause, NIL), or_selectivities); return compute_selec(root, lcons(clause, NIL), or_selectivities);
} }
}
/* /*
* compute_selec - * compute_selec -

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -45,39 +45,29 @@
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
static void static void match_index_orclauses(RelOptInfo * rel, RelOptInfo * index, int indexkey,
match_index_orclauses(RelOptInfo *rel, RelOptInfo *index, int indexkey,
int xclass, List *clauseinfo_list); int xclass, List *clauseinfo_list);
static bool static bool match_index_to_operand(int indexkey, Expr *operand,
match_index_to_operand(int indexkey, Expr *operand,
RelOptInfo * rel, RelOptInfo * index); RelOptInfo * rel, RelOptInfo * index);
static List * static List *match_index_orclause(RelOptInfo * rel, RelOptInfo * index, int indexkey,
match_index_orclause(RelOptInfo *rel, RelOptInfo *index, int indexkey,
int xclass, List *or_clauses, List *other_matching_indices); int xclass, List *or_clauses, List *other_matching_indices);
static List * 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); int *indexkeys, Oid *classes, List *clauseinfo_list);
static List * 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, List *restr_cinfo_list); int *indexkeys, Oid *classes, List *join_cinfo_list, List *restr_cinfo_list);
static ClauseInfo * static ClauseInfo *match_clause_to_indexkey(RelOptInfo * rel, RelOptInfo * index, int indexkey,
match_clause_to_indexkey(RelOptInfo *rel, RelOptInfo *index, int indexkey,
int xclass, ClauseInfo * clauseInfo, bool join); int xclass, ClauseInfo * clauseInfo, bool join);
static bool static bool pred_test(List *predicate_list, List *clauseinfo_list,
pred_test(List *predicate_list, List *clauseinfo_list,
List *joininfo_list); List *joininfo_list);
static bool one_pred_test(Expr *predicate, List *clauseinfo_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_expr_test(Expr *predicate, Node *clause);
static bool one_pred_clause_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 bool clause_pred_clause_test(Expr *predicate, Node *clause);
static List * static List *indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index,
indexable_joinclauses(RelOptInfo *rel, RelOptInfo *index,
List *joininfo_list, List *clauseinfo_list); List *joininfo_list, List *clauseinfo_list);
static List * static List *index_innerjoin(Query *root, RelOptInfo * rel,
index_innerjoin(Query *root, RelOptInfo *rel,
List *clausegroup_list, RelOptInfo * index); List *clausegroup_list, RelOptInfo * index);
static List * static List *create_index_paths(Query *root, RelOptInfo * rel, RelOptInfo * index,
create_index_paths(Query *root, RelOptInfo *rel, RelOptInfo *index,
List *clausegroup_list, bool join); List *clausegroup_list, bool join);
static List *add_index_paths(List *indexpaths, List *new_indexpaths); 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);
@@ -127,7 +117,10 @@ find_index_paths(Query *root,
{ {
index = (RelOptInfo *) lfirst(ilist); 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 (index->indpred != NIL)
if (!pred_test(index->indpred, clauseinfo_list, joininfo_list)) if (!pred_test(index->indpred, clauseinfo_list, joininfo_list))
continue; continue;
@@ -136,9 +129,9 @@ find_index_paths(Query *root,
* 1. Try matching the index against subclauses of an 'or' clause. * 1. Try matching the index against subclauses of an 'or' clause.
* The fields of the clauseinfo nodes are marked with lists of the * The fields of the clauseinfo nodes are marked with lists of the
* matching indices. No path are actually created. We currently * matching indices. No path are actually created. We currently
* only look to match the first key. We don't find multi-key index * only look to match the first key. We don't find multi-key
* cases where an AND matches the first key, and the OR matches the * index cases where an AND matches the first key, and the OR
* second key. * matches the second key.
*/ */
match_index_orclauses(rel, match_index_orclauses(rel,
index, index,
@@ -147,9 +140,9 @@ find_index_paths(Query *root,
clauseinfo_list); clauseinfo_list);
/* /*
* 2. If the keys of this index match any of the available restriction * 2. If the keys of this index match any of the available
* clauses, then create pathnodes corresponding to each group of * restriction clauses, then create pathnodes corresponding to
* usable clauses. * each group of usable clauses.
*/ */
scanclausegroups = group_clauses_by_indexkey(rel, scanclausegroups = group_clauses_by_indexkey(rel,
index, index,
@@ -167,10 +160,10 @@ find_index_paths(Query *root,
/* /*
* 3. If this index can be used with any join clause, then create * 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 * pathnodes for each group of usable clauses. An index can be
* with a join clause if its ordering is useful for a mergejoin, or if * used with a join clause if its ordering is useful for a
* the index can possibly be used for scanning the inner relation of a * mergejoin, or if the index can possibly be used for scanning
* nestloop join. * the inner relation of a nestloop join.
*/ */
joinclausegroups = indexable_joinclauses(rel, index, joininfo_list, clauseinfo_list); joinclausegroups = indexable_joinclauses(rel, index, joininfo_list, clauseinfo_list);
joinpaths = NIL; joinpaths = NIL;
@@ -323,7 +316,8 @@ match_index_orclause(RelOptInfo *rel,
foreach(clist, or_clauses) foreach(clist, or_clauses)
matching_indices = lcons(NIL, matching_indices); matching_indices = lcons(NIL, matching_indices);
} }
else matching_indices = other_matching_indices; else
matching_indices = other_matching_indices;
index_list = matching_indices; index_list = matching_indices;
@@ -344,9 +338,7 @@ match_index_orclause(RelOptInfo *rel,
rel, rel,
index) && index) &&
IsA(get_leftop((Expr *) clause), Const)))) IsA(get_leftop((Expr *) clause), Const))))
{
lfirst(matching_indices) = lcons(index, lfirst(matching_indices)); lfirst(matching_indices) = lcons(index, lfirst(matching_indices));
}
matching_indices = lnext(matching_indices); matching_indices = lnext(matching_indices);
} }
@@ -607,6 +599,7 @@ match_clause_to_indexkey(RelOptInfo *rel,
*/ */
if (!join) if (!join)
{ {
/* /*
* Check for standard s-argable clause * Check for standard s-argable clause
*/ */
@@ -622,9 +615,10 @@ match_clause_to_indexkey(RelOptInfo *rel,
index)); index));
#ifndef IGNORE_BINARY_COMPATIBLE_INDICES #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)
{ {
@@ -634,7 +628,10 @@ match_clause_to_indexkey(RelOptInfo *rel,
ltype = exprType((Node *) leftop); ltype = exprType((Node *) leftop);
rtype = exprType((Node *) rightop); 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) if ((ltype != rtype)
&& IS_BINARY_COMPATIBLE(ltype, rtype)) && IS_BINARY_COMPATIBLE(ltype, rtype))
{ {
@@ -660,12 +657,10 @@ match_clause_to_indexkey(RelOptInfo *rel,
index)); index));
if (isIndexable) if (isIndexable)
{
((Oper *) ((Expr *) clause)->oper)->opno = restrict_op; ((Oper *) ((Expr *) clause)->oper)->opno = restrict_op;
} }
} }
} }
}
#endif #endif
} }
@@ -719,16 +714,15 @@ match_clause_to_indexkey(RelOptInfo *rel,
index)); index));
if (isIndexable) if (isIndexable)
{
((Oper *) ((Expr *) clause)->oper)->opno = oprid(newop); ((Oper *) ((Expr *) clause)->oper)->opno = oprid(newop);
} }
} }
} }
}
#endif #endif
if (isIndexable) if (isIndexable)
{ {
/* /*
* In place list modification. (op const var/func) -> (op * In place list modification. (op const var/func) -> (op
* var/func const) * var/func const)

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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} */ * _enable_mergejoin} */
static Path *best_innerjoin(List *join_paths, List *outer_relid); static Path *best_innerjoin(List *join_paths, List *outer_relid);
static List * 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 *mergeinfo_list);
static List * 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, List *outerpath_list, Path *cheapest_inner, Path *best_innerjoin,
List *mergeinfo_list); List *mergeinfo_list);
static List * 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); List *innerpath_list, List *mergeinfo_list);
static bool EnoughMemoryForHashjoin(RelOptInfo * hashrel); static bool EnoughMemoryForHashjoin(RelOptInfo * hashrel);
static List * 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); List *hashinfo_list);
/* /*

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -34,15 +34,13 @@ bool _use_right_sided_plans_ = false;
static List *find_clause_joins(Query *root, RelOptInfo * outer_rel, List *joininfo_list); 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 List *find_clauseless_joins(RelOptInfo * outer_rel, List *inner_rels);
static RelOptInfo *init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo); static RelOptInfo *init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininfo);
static List * static List *new_join_tlist(List *tlist, List *other_relids,
new_join_tlist(List *tlist, List *other_relids,
int first_resdomno); int first_resdomno);
static List *new_joininfo_list(List *joininfo_list, List *join_relids); static List *new_joininfo_list(List *joininfo_list, List *join_relids);
static void add_superrels(RelOptInfo * rel, RelOptInfo * super_rel); static void add_superrels(RelOptInfo * rel, RelOptInfo * super_rel);
static bool nonoverlap_rels(RelOptInfo * rel1, RelOptInfo * rel2); static bool nonoverlap_rels(RelOptInfo * rel1, RelOptInfo * rel2);
static bool nonoverlap_sets(List *s1, List *s2); static bool nonoverlap_sets(List *s1, List *s2);
static void static void set_joinrel_size(RelOptInfo * joinrel, RelOptInfo * outer_rel, RelOptInfo * inner_rel,
set_joinrel_size(RelOptInfo *joinrel, RelOptInfo *outer_rel, RelOptInfo *inner_rel,
JoinInfo * jinfo); JoinInfo * jinfo);
/* /*

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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" #include "optimizer/ordering.h"
static int static int match_pathkey_joinkeys(List *pathkey, List *joinkeys,
match_pathkey_joinkeys(List *pathkey, List *joinkeys,
int which_subkey); int which_subkey);
static bool static bool every_func(List *joinkeys, List *pathkey,
every_func(List *joinkeys, List *pathkey,
int which_subkey); int which_subkey);
static List * static List *new_join_pathkey(List *subkeys,
new_join_pathkey(List *subkeys,
List *considered_subkeys, List *join_rel_tlist, List *considered_subkeys, List *join_rel_tlist,
List *joinclauses); List *joinclauses);
static List * static List *new_matching_subkeys(Var *subkey, List *considered_subkeys,
new_matching_subkeys(Var *subkey, List *considered_subkeys,
List *join_rel_tlist, List *joinclauses); List *join_rel_tlist, List *joinclauses);
/**************************************************************************** /****************************************************************************

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.10 1998/09/01 03:23:29 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.11 1998/09/01 04:29:41 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -35,8 +35,7 @@ static void
best_or_subclause_indices(Query *root, RelOptInfo * rel, List *subclauses, best_or_subclause_indices(Query *root, RelOptInfo * rel, List *subclauses,
List *indices, List *examined_indexids, Cost subcost, List *selectivities, List *indices, List *examined_indexids, Cost subcost, List *selectivities,
List **indexids, Cost *cost, List **selecs); List **indexids, Cost *cost, List **selecs);
static void static void best_or_subclause_index(Query *root, RelOptInfo * rel, Expr *subclause,
best_or_subclause_index(Query *root, RelOptInfo *rel, Expr *subclause,
List *indices, int *indexid, Cost *cost, Cost *selec); List *indices, int *indexid, Cost *cost, Cost *selec);

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