Used modified version of indent that understands over 100 typedefs.
This commit is contained in:
parent
075cede748
commit
59f6a57e59
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
|
|
||||||
TimeADT *
|
TimeADT *
|
||||||
time_difference(TimeADT * time1, TimeADT * time2)
|
time_difference(TimeADT *time1, TimeADT *time2)
|
||||||
{
|
{
|
||||||
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
|
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
|
||||||
|
|
||||||
@ -51,25 +51,25 @@ currentdate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int4
|
int4
|
||||||
hours(TimeADT * time)
|
hours(TimeADT *time)
|
||||||
{
|
{
|
||||||
return (*time / (60 * 60));
|
return (*time / (60 * 60));
|
||||||
}
|
}
|
||||||
|
|
||||||
int4
|
int4
|
||||||
minutes(TimeADT * time)
|
minutes(TimeADT *time)
|
||||||
{
|
{
|
||||||
return (((int) (*time / 60)) % 60);
|
return (((int) (*time / 60)) % 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
int4
|
int4
|
||||||
seconds(TimeADT * time)
|
seconds(TimeADT *time)
|
||||||
{
|
{
|
||||||
return (((int) *time) % 60);
|
return (((int) *time) % 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
int4
|
int4
|
||||||
day(DateADT * date)
|
day(DateADT *date)
|
||||||
{
|
{
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ day(DateADT * date)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int4
|
int4
|
||||||
month(DateADT * date)
|
month(DateADT *date)
|
||||||
{
|
{
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ month(DateADT * date)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int4
|
int4
|
||||||
year(DateADT * date)
|
year(DateADT *date)
|
||||||
{
|
{
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ year(DateADT * date)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int4
|
int4
|
||||||
asminutes(TimeADT * time)
|
asminutes(TimeADT *time)
|
||||||
{
|
{
|
||||||
int seconds = (int) *time;
|
int seconds = (int) *time;
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ asminutes(TimeADT * time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int4
|
int4
|
||||||
asseconds(TimeADT * time)
|
asseconds(TimeADT *time)
|
||||||
{
|
{
|
||||||
int seconds = (int) *time;
|
int seconds = (int) *time;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ int64 *int48(int32 val);
|
|||||||
int32 int84(int64 * val);
|
int32 int84(int64 * val);
|
||||||
|
|
||||||
#if FALSE
|
#if FALSE
|
||||||
int64 *int28(int16 val);
|
int64 *int28 (int16 val);
|
||||||
int16 int82(int64 * val);
|
int16 int82(int64 * val);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -340,7 +340,7 @@ int84(int64 * val)
|
|||||||
|
|
||||||
#if FALSE
|
#if FALSE
|
||||||
int64 *
|
int64 *
|
||||||
int28(int16 val)
|
int28 (int16 val)
|
||||||
{
|
{
|
||||||
int64 *result;
|
int64 *result;
|
||||||
|
|
||||||
|
@ -44,17 +44,17 @@ va_dcl
|
|||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
||||||
/* call one clean up function if defined */
|
/* call one clean up function if defined */
|
||||||
if ((sig_func = signal(SIGTERM, SIG_DFL)) != SIG_DFL &&
|
if ((sig_func = signal(SIGTERM, SIG_DFL)) !=SIG_DFL &&
|
||||||
sig_func != SIG_IGN)
|
sig_func !=SIG_IGN)
|
||||||
(*sig_func) (0);
|
(*sig_func) (0);
|
||||||
else if ((sig_func = signal(SIGHUP, SIG_DFL)) != SIG_DFL &&
|
else if ((sig_func = signal(SIGHUP, SIG_DFL)) !=SIG_DFL &&
|
||||||
sig_func != SIG_IGN)
|
sig_func !=SIG_IGN)
|
||||||
(*sig_func) (0);
|
(*sig_func) (0);
|
||||||
else if ((sig_func = signal(SIGINT, SIG_DFL)) != SIG_DFL &&
|
else if ((sig_func = signal(SIGINT, SIG_DFL)) !=SIG_DFL &&
|
||||||
sig_func != SIG_IGN)
|
sig_func !=SIG_IGN)
|
||||||
(*sig_func) (0);
|
(*sig_func) (0);
|
||||||
else if ((sig_func = signal(SIGQUIT, SIG_DFL)) != SIG_DFL &&
|
else if ((sig_func = signal(SIGQUIT, SIG_DFL)) !=SIG_DFL &&
|
||||||
sig_func != SIG_IGN)
|
sig_func !=SIG_IGN)
|
||||||
(*sig_func) (0);
|
(*sig_func) (0);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
char *soundex(char *instr, char *outstr);
|
char *soundex(char *instr, char *outstr);
|
||||||
|
|
||||||
text *
|
text *
|
||||||
text_soundex(text * t)
|
text_soundex(text *t)
|
||||||
{
|
{
|
||||||
/* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
|
/* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
|
||||||
char *table = "01230120022455012623010202";
|
char *table = "01230120022455012623010202";
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.23 1997/09/08 02:19:47 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.24 1997/09/08 21:40:18 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The old interface functions have been converted to macros
|
* The old interface functions have been converted to macros
|
||||||
@ -116,7 +116,7 @@ DataFill(char *data,
|
|||||||
Datum value[],
|
Datum value[],
|
||||||
char nulls[],
|
char nulls[],
|
||||||
char *infomask,
|
char *infomask,
|
||||||
bits8 * bit)
|
bits8 *bit)
|
||||||
{
|
{
|
||||||
bits8 *bitP = 0;
|
bits8 *bitP = 0;
|
||||||
int bitmask = 0;
|
int bitmask = 0;
|
||||||
@ -448,7 +448,7 @@ char *
|
|||||||
fastgetattr(HeapTuple tup,
|
fastgetattr(HeapTuple tup,
|
||||||
int attnum,
|
int attnum,
|
||||||
TupleDesc tupleDesc,
|
TupleDesc tupleDesc,
|
||||||
bool * isnull)
|
bool *isnull)
|
||||||
{
|
{
|
||||||
char *tp; /* ptr to att in tuple */
|
char *tp; /* ptr to att in tuple */
|
||||||
bits8 *bp = NULL; /* ptr to att in tuple */
|
bits8 *bp = NULL; /* ptr to att in tuple */
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.17 1997/09/08 02:19:54 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.18 1997/09/08 21:40:24 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -29,7 +29,7 @@
|
|||||||
static Size IndexInfoFindDataOffset(unsigned short t_info);
|
static Size IndexInfoFindDataOffset(unsigned short t_info);
|
||||||
static char *
|
static char *
|
||||||
fastgetiattr(IndexTuple tup, int attnum,
|
fastgetiattr(IndexTuple tup, int attnum,
|
||||||
TupleDesc att, bool * isnull);
|
TupleDesc att, bool *isnull);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
* index_ tuple interface routines
|
* index_ tuple interface routines
|
||||||
@ -137,7 +137,7 @@ static char *
|
|||||||
fastgetiattr(IndexTuple tup,
|
fastgetiattr(IndexTuple tup,
|
||||||
int attnum,
|
int attnum,
|
||||||
TupleDesc tupleDesc,
|
TupleDesc tupleDesc,
|
||||||
bool * isnull)
|
bool *isnull)
|
||||||
{
|
{
|
||||||
register char *tp; /* ptr to att in tuple */
|
register char *tp; /* ptr to att in tuple */
|
||||||
register char *bp = NULL; /* ptr to att in tuple */
|
register char *bp = NULL; /* ptr to att in tuple */
|
||||||
@ -368,7 +368,7 @@ fastgetiattr(IndexTuple tup,
|
|||||||
off = SHORTALIGN(off) +sizeof(short);
|
off = SHORTALIGN(off) +sizeof(short);
|
||||||
break;
|
break;
|
||||||
case sizeof(int32):
|
case sizeof(int32):
|
||||||
off = INTALIGN(off) + sizeof(int32);
|
off = INTALIGN(off) +sizeof(int32);
|
||||||
break;
|
break;
|
||||||
case -1:
|
case -1:
|
||||||
usecache = false;
|
usecache = false;
|
||||||
@ -430,7 +430,7 @@ Datum
|
|||||||
index_getattr(IndexTuple tuple,
|
index_getattr(IndexTuple tuple,
|
||||||
AttrNumber attNum,
|
AttrNumber attNum,
|
||||||
TupleDesc tupDesc,
|
TupleDesc tupDesc,
|
||||||
bool * isNullOutP)
|
bool *isNullOutP)
|
||||||
{
|
{
|
||||||
Assert(attNum > 0);
|
Assert(attNum > 0);
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ IndexInfoFindDataOffset(unsigned short t_info)
|
|||||||
* we assume we have space that is already palloc'ed.
|
* we assume we have space that is already palloc'ed.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
CopyIndexTuple(IndexTuple source, IndexTuple * target)
|
CopyIndexTuple(IndexTuple source, IndexTuple *target)
|
||||||
{
|
{
|
||||||
Size size;
|
Size size;
|
||||||
IndexTuple ret;
|
IndexTuple ret;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.22 1997/09/08 20:53:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.23 1997/09/08 21:40:27 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
|
||||||
@ -437,7 +437,7 @@ TupleDescMakeSelfReference(TupleDesc desc,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleDesc
|
TupleDesc
|
||||||
BuildDescForRelation(List * schema, char *relname)
|
BuildDescForRelation(List *schema, char *relname)
|
||||||
{
|
{
|
||||||
int natts;
|
int natts;
|
||||||
AttrNumber attnum;
|
AttrNumber attnum;
|
||||||
|
@ -34,42 +34,42 @@
|
|||||||
/* 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);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** routine to build an index. Basically calls insert over and over
|
** routine to build an index. Basically calls insert over and over
|
||||||
@ -81,9 +81,9 @@ gistbuild(Relation heap,
|
|||||||
AttrNumber *attnum,
|
AttrNumber *attnum,
|
||||||
IndexStrategy istrat,
|
IndexStrategy istrat,
|
||||||
uint16 pint,
|
uint16 pint,
|
||||||
Datum * params,
|
Datum *params,
|
||||||
FuncIndexInfo * finfo,
|
FuncIndexInfo *finfo,
|
||||||
PredInfo * predInfo)
|
PredInfo *predInfo)
|
||||||
{
|
{
|
||||||
HeapScanDesc scan;
|
HeapScanDesc scan;
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
@ -328,7 +328,7 @@ gistbuild(Relation heap,
|
|||||||
* It doesn't do any work; just locks the relation and passes the buck.
|
* It doesn't do any work; just locks the relation and passes the buck.
|
||||||
*/
|
*/
|
||||||
InsertIndexResult
|
InsertIndexResult
|
||||||
gistinsert(Relation r, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
||||||
{
|
{
|
||||||
InsertIndexResult res;
|
InsertIndexResult res;
|
||||||
IndexTuple itup;
|
IndexTuple itup;
|
||||||
@ -374,15 +374,15 @@ gistinsert(Relation r, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation
|
|||||||
** on the page, for example, or do something special for leaf nodes.)
|
** on the page, for example, or do something special for leaf nodes.)
|
||||||
*/
|
*/
|
||||||
static OffsetNumber
|
static OffsetNumber
|
||||||
gistPageAddItem(GISTSTATE * giststate,
|
gistPageAddItem(GISTSTATE *giststate,
|
||||||
Relation r,
|
Relation r,
|
||||||
Page page,
|
Page page,
|
||||||
Item item,
|
Item item,
|
||||||
Size size,
|
Size size,
|
||||||
OffsetNumber offsetNumber,
|
OffsetNumber offsetNumber,
|
||||||
ItemIdFlags flags,
|
ItemIdFlags flags,
|
||||||
GISTENTRY * dentry,
|
GISTENTRY *dentry,
|
||||||
IndexTuple * newtup)
|
IndexTuple *newtup)
|
||||||
{
|
{
|
||||||
GISTENTRY tmpcentry;
|
GISTENTRY tmpcentry;
|
||||||
IndexTuple itup = (IndexTuple) item;
|
IndexTuple itup = (IndexTuple) item;
|
||||||
@ -403,7 +403,7 @@ gistPageAddItem(GISTSTATE * giststate,
|
|||||||
&& tmpcentry.pred != (((char *) itup) + sizeof(IndexTupleData)))
|
&& tmpcentry.pred != (((char *) itup) + sizeof(IndexTupleData)))
|
||||||
pfree(tmpcentry.pred);
|
pfree(tmpcentry.pred);
|
||||||
|
|
||||||
return (PageAddItem(page, (Item) * newtup, IndexTupleSize(*newtup),
|
return (PageAddItem(page, (Item) *newtup, IndexTupleSize(*newtup),
|
||||||
offsetNumber, flags));
|
offsetNumber, flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,7 +411,7 @@ gistPageAddItem(GISTSTATE * giststate,
|
|||||||
static InsertIndexResult
|
static InsertIndexResult
|
||||||
gistdoinsert(Relation r,
|
gistdoinsert(Relation r,
|
||||||
IndexTuple itup, /* itup contains compressed entry */
|
IndexTuple itup, /* itup contains compressed entry */
|
||||||
GISTSTATE * giststate)
|
GISTSTATE *giststate)
|
||||||
{
|
{
|
||||||
GISTENTRY tmpdentry;
|
GISTENTRY tmpdentry;
|
||||||
InsertIndexResult res;
|
InsertIndexResult res;
|
||||||
@ -468,8 +468,8 @@ static BlockNumber
|
|||||||
gistChooseSubtree(Relation r, IndexTuple itup, /* itup has compressed
|
gistChooseSubtree(Relation r, IndexTuple itup, /* itup has compressed
|
||||||
* entry */
|
* entry */
|
||||||
int level,
|
int level,
|
||||||
GISTSTATE * giststate,
|
GISTSTATE *giststate,
|
||||||
GISTSTACK ** retstack /* out */ ,
|
GISTSTACK **retstack /* out */ ,
|
||||||
Buffer *leafbuf /* out */ )
|
Buffer *leafbuf /* out */ )
|
||||||
{
|
{
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
@ -520,11 +520,11 @@ gistChooseSubtree(Relation r, IndexTuple itup, /* itup has compressed
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gistAdjustKeys(Relation r,
|
gistAdjustKeys(Relation r,
|
||||||
GISTSTACK * stk,
|
GISTSTACK *stk,
|
||||||
BlockNumber blk,
|
BlockNumber blk,
|
||||||
char *datum, /* datum is uncompressed */
|
char *datum, /* datum is uncompressed */
|
||||||
int att_size,
|
int att_size,
|
||||||
GISTSTATE * giststate)
|
GISTSTATE *giststate)
|
||||||
{
|
{
|
||||||
char *oldud;
|
char *oldud;
|
||||||
Page p;
|
Page p;
|
||||||
@ -603,14 +603,14 @@ gistAdjustKeys(Relation r,
|
|||||||
|
|
||||||
/* delete old tuple */
|
/* delete old tuple */
|
||||||
ItemPointerSet(&oldtid, stk->gs_blk, stk->gs_child);
|
ItemPointerSet(&oldtid, stk->gs_blk, stk->gs_child);
|
||||||
gistdelete(r, (ItemPointer) & oldtid);
|
gistdelete(r, (ItemPointer) &oldtid);
|
||||||
|
|
||||||
/* generate and insert new tuple */
|
/* generate and insert new tuple */
|
||||||
tupDesc = r->rd_att;
|
tupDesc = r->rd_att;
|
||||||
isnull = (char *) palloc(r->rd_rel->relnatts);
|
isnull = (char *) palloc(r->rd_rel->relnatts);
|
||||||
memset(isnull, ' ', r->rd_rel->relnatts);
|
memset(isnull, ' ', r->rd_rel->relnatts);
|
||||||
newtup = (IndexTuple) index_formtuple(tupDesc,
|
newtup = (IndexTuple) index_formtuple(tupDesc,
|
||||||
(Datum *) & centry.pred, isnull);
|
(Datum *) ¢ry.pred, isnull);
|
||||||
pfree(isnull);
|
pfree(isnull);
|
||||||
/* set pointer in new tuple to point to current child */
|
/* set pointer in new tuple to point to current child */
|
||||||
ItemPointerSet(&oldtid, blk, 1);
|
ItemPointerSet(&oldtid, blk, 1);
|
||||||
@ -644,9 +644,9 @@ gistAdjustKeys(Relation r,
|
|||||||
static InsertIndexResult
|
static InsertIndexResult
|
||||||
gistSplit(Relation r,
|
gistSplit(Relation r,
|
||||||
Buffer buffer,
|
Buffer buffer,
|
||||||
GISTSTACK * stack,
|
GISTSTACK *stack,
|
||||||
IndexTuple itup, /* contains compressed entry */
|
IndexTuple itup, /* contains compressed entry */
|
||||||
GISTSTATE * giststate)
|
GISTSTATE *giststate)
|
||||||
{
|
{
|
||||||
Page p;
|
Page p;
|
||||||
Buffer leftbuf,
|
Buffer leftbuf,
|
||||||
@ -861,9 +861,9 @@ gistSplit(Relation r,
|
|||||||
tupDesc = r->rd_att;
|
tupDesc = r->rd_att;
|
||||||
|
|
||||||
ltup = (IndexTuple) index_formtuple(tupDesc,
|
ltup = (IndexTuple) index_formtuple(tupDesc,
|
||||||
(Datum *) & (v.spl_ldatum), isnull);
|
(Datum *) &(v.spl_ldatum), isnull);
|
||||||
rtup = (IndexTuple) index_formtuple(tupDesc,
|
rtup = (IndexTuple) index_formtuple(tupDesc,
|
||||||
(Datum *) & (v.spl_rdatum), isnull);
|
(Datum *) &(v.spl_rdatum), isnull);
|
||||||
pfree(isnull);
|
pfree(isnull);
|
||||||
|
|
||||||
/* set pointers to new child pages in the internal index tuples */
|
/* set pointers to new child pages in the internal index tuples */
|
||||||
@ -884,10 +884,10 @@ gistSplit(Relation r,
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
gistintinsert(Relation r,
|
gistintinsert(Relation r,
|
||||||
GISTSTACK * stk,
|
GISTSTACK *stk,
|
||||||
IndexTuple ltup, /* new version of entry for old page */
|
IndexTuple ltup, /* new version of entry for old page */
|
||||||
IndexTuple rtup, /* entry for new page */
|
IndexTuple rtup, /* entry for new page */
|
||||||
GISTSTATE * giststate)
|
GISTSTATE *giststate)
|
||||||
{
|
{
|
||||||
ItemPointerData ltid;
|
ItemPointerData ltid;
|
||||||
|
|
||||||
@ -899,7 +899,7 @@ gistintinsert(Relation r,
|
|||||||
|
|
||||||
/* remove old left pointer, insert the 2 new entries */
|
/* remove old left pointer, insert the 2 new entries */
|
||||||
ItemPointerSet(<id, stk->gs_blk, stk->gs_child);
|
ItemPointerSet(<id, stk->gs_blk, stk->gs_child);
|
||||||
gistdelete(r, (ItemPointer) & ltid);
|
gistdelete(r, (ItemPointer) <id);
|
||||||
gistentryinserttwo(r, stk, ltup, rtup, giststate);
|
gistentryinserttwo(r, stk, ltup, rtup, giststate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -908,8 +908,8 @@ gistintinsert(Relation r,
|
|||||||
** Insert two entries onto one page, handling a split for either one!
|
** Insert two entries onto one page, handling a split for either one!
|
||||||
*/
|
*/
|
||||||
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)
|
||||||
{
|
{
|
||||||
Buffer b;
|
Buffer b;
|
||||||
Page p;
|
Page p;
|
||||||
@ -950,8 +950,8 @@ gistentryinserttwo(Relation r, GISTSTACK * stk, IndexTuple ltup,
|
|||||||
** Insert an entry onto a page
|
** Insert an entry onto a page
|
||||||
*/
|
*/
|
||||||
static InsertIndexResult
|
static InsertIndexResult
|
||||||
gistentryinsert(Relation r, GISTSTACK * stk, IndexTuple tup,
|
gistentryinsert(Relation r, GISTSTACK *stk, IndexTuple tup,
|
||||||
GISTSTATE * giststate)
|
GISTSTATE *giststate)
|
||||||
{
|
{
|
||||||
Buffer b;
|
Buffer b;
|
||||||
Page p;
|
Page p;
|
||||||
@ -990,7 +990,7 @@ gistentryinsert(Relation r, GISTSTACK * stk, IndexTuple tup,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gistnewroot(GISTSTATE * giststate, Relation r, IndexTuple lt, IndexTuple rt)
|
gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple lt, IndexTuple rt)
|
||||||
{
|
{
|
||||||
Buffer b;
|
Buffer b;
|
||||||
Page p;
|
Page p;
|
||||||
@ -1042,7 +1042,7 @@ GISTInitBuffer(Buffer b, uint32 f)
|
|||||||
*/
|
*/
|
||||||
static OffsetNumber
|
static OffsetNumber
|
||||||
gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
|
gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
|
||||||
GISTSTATE * giststate)
|
GISTSTATE *giststate)
|
||||||
{
|
{
|
||||||
OffsetNumber maxoff;
|
OffsetNumber maxoff;
|
||||||
OffsetNumber i;
|
OffsetNumber i;
|
||||||
@ -1095,7 +1095,7 @@ gistnospace(Page p, IndexTuple it)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gistfreestack(GISTSTACK * s)
|
gistfreestack(GISTSTACK *s)
|
||||||
{
|
{
|
||||||
GISTSTACK *p;
|
GISTSTACK *p;
|
||||||
|
|
||||||
@ -1140,7 +1140,7 @@ gistdelete(Relation r, ItemPointer tid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
initGISTstate(GISTSTATE * giststate, Relation index)
|
initGISTstate(GISTSTATE *giststate, Relation index)
|
||||||
{
|
{
|
||||||
RegProcedure consistent_proc,
|
RegProcedure consistent_proc,
|
||||||
union_proc,
|
union_proc,
|
||||||
@ -1237,7 +1237,7 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
|
|||||||
for (blank = 0; blank < r->rd_rel->relnatts; blank++)
|
for (blank = 0; blank < r->rd_rel->relnatts; blank++)
|
||||||
isnull[blank] = ' ';
|
isnull[blank] = ' ';
|
||||||
newtup = (IndexTuple) index_formtuple(tupDesc,
|
newtup = (IndexTuple) index_formtuple(tupDesc,
|
||||||
(Datum *) & (entry.pred),
|
(Datum *) &(entry.pred),
|
||||||
isnull);
|
isnull);
|
||||||
newtup->t_tid = t->t_tid;
|
newtup->t_tid = t->t_tid;
|
||||||
pfree(isnull);
|
pfree(isnull);
|
||||||
@ -1250,7 +1250,7 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
|
|||||||
** initialize a GiST entry with a decompressed version of pred
|
** initialize a GiST entry with a decompressed version of pred
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gistdentryinit(GISTSTATE * giststate, GISTENTRY * e, char *pr, Relation r,
|
gistdentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r,
|
||||||
Page pg, OffsetNumber o, int b, bool l)
|
Page pg, OffsetNumber o, int b, bool l)
|
||||||
{
|
{
|
||||||
GISTENTRY *dep;
|
GISTENTRY *dep;
|
||||||
@ -1271,7 +1271,7 @@ gistdentryinit(GISTSTATE * giststate, GISTENTRY * e, char *pr, Relation r,
|
|||||||
** initialize a GiST entry with a compressed version of pred
|
** initialize a GiST entry with a compressed version of pred
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
gistcentryinit(GISTSTATE * giststate, GISTENTRY * e, char *pr, Relation r,
|
gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r,
|
||||||
Page pg, OffsetNumber o, int b, bool l)
|
Page pg, OffsetNumber o, int b, bool l)
|
||||||
{
|
{
|
||||||
GISTENTRY *cep;
|
GISTENTRY *cep;
|
||||||
@ -1351,7 +1351,7 @@ _gistdump(Relation r)
|
|||||||
|
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
static char *
|
static char *
|
||||||
text_range_out(TXTRANGE * r)
|
text_range_out(TXTRANGE *r)
|
||||||
{
|
{
|
||||||
char *result;
|
char *result;
|
||||||
char *lower,
|
char *lower,
|
||||||
@ -1378,7 +1378,7 @@ text_range_out(TXTRANGE * r)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
int_range_out(INTRANGE * r)
|
int_range_out(INTRANGE *r)
|
||||||
{
|
{
|
||||||
char *result;
|
char *result;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ 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);
|
||||||
|
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ gistindex_keytest(IndexTuple tuple,
|
|||||||
TupleDesc tupdesc,
|
TupleDesc tupdesc,
|
||||||
int scanKeySize,
|
int scanKeySize,
|
||||||
ScanKey key,
|
ScanKey key,
|
||||||
GISTSTATE * giststate,
|
GISTSTATE *giststate,
|
||||||
Relation r,
|
Relation r,
|
||||||
Page p,
|
Page p,
|
||||||
OffsetNumber offset)
|
OffsetNumber offset)
|
||||||
|
@ -33,7 +33,7 @@ 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,
|
||||||
@ -53,7 +53,7 @@ typedef struct GISTScanListData
|
|||||||
{
|
{
|
||||||
IndexScanDesc gsl_scan;
|
IndexScanDesc gsl_scan;
|
||||||
struct GISTScanListData *gsl_next;
|
struct GISTScanListData *gsl_next;
|
||||||
} GISTScanListData;
|
} GISTScanListData;
|
||||||
|
|
||||||
typedef GISTScanListData *GISTScanList;
|
typedef GISTScanListData *GISTScanList;
|
||||||
|
|
||||||
@ -418,7 +418,7 @@ adjustiptr(IndexScanDesc s,
|
|||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
adjuststack(GISTSTACK * stk,
|
adjuststack(GISTSTACK *stk,
|
||||||
BlockNumber blkno,
|
BlockNumber blkno,
|
||||||
OffsetNumber offnum)
|
OffsetNumber offnum)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.15 1997/09/08 20:53:53 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.16 1997/09/08 21:40:45 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This file contains only the public interface routines.
|
* This file contains only the public interface routines.
|
||||||
@ -48,9 +48,9 @@ hashbuild(Relation heap,
|
|||||||
AttrNumber *attnum,
|
AttrNumber *attnum,
|
||||||
IndexStrategy istrat,
|
IndexStrategy istrat,
|
||||||
uint16 pcount,
|
uint16 pcount,
|
||||||
Datum * params,
|
Datum *params,
|
||||||
FuncIndexInfo * finfo,
|
FuncIndexInfo *finfo,
|
||||||
PredInfo * predInfo)
|
PredInfo *predInfo)
|
||||||
{
|
{
|
||||||
HeapScanDesc hscan;
|
HeapScanDesc hscan;
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
@ -278,7 +278,7 @@ hashbuild(Relation heap,
|
|||||||
* to the caller.
|
* to the caller.
|
||||||
*/
|
*/
|
||||||
InsertIndexResult
|
InsertIndexResult
|
||||||
hashinsert(Relation rel, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
hashinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
||||||
{
|
{
|
||||||
HashItem hitem;
|
HashItem hitem;
|
||||||
IndexTuple itup;
|
IndexTuple itup;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.5 1997/09/08 02:20:13 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.6 1997/09/08 21:40:47 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
|
||||||
@ -23,7 +23,7 @@
|
|||||||
uint32
|
uint32
|
||||||
hashint2(int16 key)
|
hashint2(int16 key)
|
||||||
{
|
{
|
||||||
return ((uint32) ~ key);
|
return ((uint32) ~key);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32
|
uint32
|
||||||
@ -130,7 +130,7 @@ hashfloat8(float64 keyp)
|
|||||||
uint32
|
uint32
|
||||||
hashoid(Oid key)
|
hashoid(Oid key)
|
||||||
{
|
{
|
||||||
return ((uint32) ~ key);
|
return ((uint32) ~key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ hashchar8(char *key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32
|
uint32
|
||||||
hashname(NameData * n)
|
hashname(NameData *n)
|
||||||
{
|
{
|
||||||
uint32 h;
|
uint32 h;
|
||||||
int len;
|
int len;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.10 1997/09/08 02:20:20 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.11 1997/09/08 21:40:48 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Because we can be doing an index scan on a relation while we
|
* Because we can be doing an index scan on a relation while we
|
||||||
@ -38,7 +38,7 @@ typedef struct HashScanListData
|
|||||||
{
|
{
|
||||||
IndexScanDesc hashsl_scan;
|
IndexScanDesc hashsl_scan;
|
||||||
struct HashScanListData *hashsl_next;
|
struct HashScanListData *hashsl_next;
|
||||||
} HashScanListData;
|
} HashScanListData;
|
||||||
|
|
||||||
typedef HashScanListData *HashScanList;
|
typedef HashScanListData *HashScanList;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.13 1997/09/08 20:54:05 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.14 1997/09/08 21:40:52 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -127,7 +127,7 @@ _hash_next(IndexScanDesc scan, ScanDirection dir)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
_hash_readnext(Relation rel,
|
_hash_readnext(Relation rel,
|
||||||
Buffer *bufp, Page * pagep, HashPageOpaque * opaquep)
|
Buffer *bufp, Page *pagep, HashPageOpaque *opaquep)
|
||||||
{
|
{
|
||||||
BlockNumber blkno;
|
BlockNumber blkno;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ _hash_readnext(Relation rel,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
_hash_readprev(Relation rel,
|
_hash_readprev(Relation rel,
|
||||||
Buffer *bufp, Page * pagep, HashPageOpaque * opaquep)
|
Buffer *bufp, Page *pagep, HashPageOpaque *opaquep)
|
||||||
{
|
{
|
||||||
BlockNumber blkno;
|
BlockNumber blkno;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.18 1997/09/08 20:54:08 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.19 1997/09/08 21:40:57 momjian Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -1188,7 +1188,7 @@ heap_insert(Relation relation, HeapTuple tup)
|
|||||||
*/
|
*/
|
||||||
SetRefreshWhenInvalidate(ImmediateInvalidation);
|
SetRefreshWhenInvalidate(ImmediateInvalidation);
|
||||||
RelationInvalidateHeapTuple(relation, tup);
|
RelationInvalidateHeapTuple(relation, tup);
|
||||||
SetRefreshWhenInvalidate((bool) ! ImmediateInvalidation);
|
SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (tup->t_oid);
|
return (tup->t_oid);
|
||||||
@ -1287,7 +1287,7 @@ heap_delete(Relation relation, ItemPointer tid)
|
|||||||
*/
|
*/
|
||||||
SetRefreshWhenInvalidate(ImmediateInvalidation);
|
SetRefreshWhenInvalidate(ImmediateInvalidation);
|
||||||
RelationInvalidateHeapTuple(relation, tp);
|
RelationInvalidateHeapTuple(relation, tp);
|
||||||
SetRefreshWhenInvalidate((bool) ! ImmediateInvalidation);
|
SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
|
||||||
|
|
||||||
WriteBuffer(b);
|
WriteBuffer(b);
|
||||||
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
|
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
|
||||||
@ -1441,7 +1441,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
|
|||||||
*/
|
*/
|
||||||
SetRefreshWhenInvalidate(ImmediateInvalidation);
|
SetRefreshWhenInvalidate(ImmediateInvalidation);
|
||||||
RelationInvalidateHeapTuple(relation, tp);
|
RelationInvalidateHeapTuple(relation, tp);
|
||||||
SetRefreshWhenInvalidate((bool) ! ImmediateInvalidation);
|
SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
|
||||||
|
|
||||||
WriteBuffer(buffer);
|
WriteBuffer(buffer);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.15 1997/09/08 02:20:37 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.16 1997/09/08 21:41:06 momjian Exp $
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
* index_open - open an index relation by relationId
|
* index_open - open an index relation by relationId
|
||||||
@ -162,7 +162,7 @@ index_close(Relation relation)
|
|||||||
*/
|
*/
|
||||||
InsertIndexResult
|
InsertIndexResult
|
||||||
index_insert(Relation relation,
|
index_insert(Relation relation,
|
||||||
Datum * datum,
|
Datum *datum,
|
||||||
char *nulls,
|
char *nulls,
|
||||||
ItemPointer heap_t_ctid,
|
ItemPointer heap_t_ctid,
|
||||||
Relation heapRel)
|
Relation heapRel)
|
||||||
@ -371,8 +371,8 @@ GetIndexValue(HeapTuple tuple,
|
|||||||
TupleDesc hTupDesc,
|
TupleDesc hTupDesc,
|
||||||
int attOff,
|
int attOff,
|
||||||
AttrNumber attrNums[],
|
AttrNumber attrNums[],
|
||||||
FuncIndexInfo * fInfo,
|
FuncIndexInfo *fInfo,
|
||||||
bool * attNull,
|
bool *attNull,
|
||||||
Buffer buffer)
|
Buffer buffer)
|
||||||
{
|
{
|
||||||
Datum returnVal;
|
Datum returnVal;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.11 1997/09/08 02:20:41 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.12 1997/09/08 21:41:07 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -540,7 +540,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
IndexSupportInitialize(IndexStrategy indexStrategy,
|
IndexSupportInitialize(IndexStrategy indexStrategy,
|
||||||
RegProcedure * indexSupport,
|
RegProcedure *indexSupport,
|
||||||
Oid indexObjectId,
|
Oid indexObjectId,
|
||||||
Oid accessMethodObjectId,
|
Oid accessMethodObjectId,
|
||||||
StrategyNumber maxStrategyNumber,
|
StrategyNumber maxStrategyNumber,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.12 1997/09/08 02:20:44 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.13 1997/09/08 21:41:11 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
|
||||||
@ -126,7 +126,7 @@ btchar16cmp(char *a, char *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32
|
int32
|
||||||
btnamecmp(NameData * a, NameData * b)
|
btnamecmp(NameData *a, NameData *b)
|
||||||
{
|
{
|
||||||
return (strncmp(a->data, b->data, NAMEDATALEN));
|
return (strncmp(a->data, b->data, NAMEDATALEN));
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.19 1997/09/08 02:20:46 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.20 1997/09/08 21:41:18 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -435,7 +435,7 @@ _bt_insertonpg(Relation rel,
|
|||||||
maxoff = PageGetMaxOffsetNumber(page);
|
maxoff = PageGetMaxOffsetNumber(page);
|
||||||
llimit = PageGetPageSize(page) - sizeof(PageHeaderData) -
|
llimit = PageGetPageSize(page) - sizeof(PageHeaderData) -
|
||||||
DOUBLEALIGN(sizeof(BTPageOpaqueData))
|
DOUBLEALIGN(sizeof(BTPageOpaqueData))
|
||||||
+ sizeof(ItemIdData);
|
+sizeof(ItemIdData);
|
||||||
llimit /= 2;
|
llimit /= 2;
|
||||||
firstright = _bt_findsplitloc(rel, page, start, maxoff, llimit);
|
firstright = _bt_findsplitloc(rel, page, start, maxoff, llimit);
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.22 1997/09/08 20:54:21 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.23 1997/09/08 21:41:24 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This file contains only the public interface routines.
|
* This file contains only the public interface routines.
|
||||||
@ -59,9 +59,9 @@ btbuild(Relation heap,
|
|||||||
AttrNumber *attnum,
|
AttrNumber *attnum,
|
||||||
IndexStrategy istrat,
|
IndexStrategy istrat,
|
||||||
uint16 pcount,
|
uint16 pcount,
|
||||||
Datum * params,
|
Datum *params,
|
||||||
FuncIndexInfo * finfo,
|
FuncIndexInfo *finfo,
|
||||||
PredInfo * predInfo)
|
PredInfo *predInfo)
|
||||||
{
|
{
|
||||||
HeapScanDesc hscan;
|
HeapScanDesc hscan;
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
@ -356,7 +356,7 @@ btbuild(Relation heap,
|
|||||||
* return an InsertIndexResult to the caller.
|
* return an InsertIndexResult to the caller.
|
||||||
*/
|
*/
|
||||||
InsertIndexResult
|
InsertIndexResult
|
||||||
btinsert(Relation rel, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
btinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
||||||
{
|
{
|
||||||
BTItem btitem;
|
BTItem btitem;
|
||||||
IndexTuple itup;
|
IndexTuple itup;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Id: nbtsort.c,v 1.22 1997/09/08 20:54:28 momjian Exp $
|
* $Id: nbtsort.c,v 1.23 1997/09/08 21:41:28 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -800,7 +800,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
|
|||||||
* allocate a new, clean btree page, not linked to any siblings.
|
* allocate a new, clean btree page, not linked to any siblings.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_bt_blnewpage(Relation index, Buffer *buf, Page * page, int flags)
|
_bt_blnewpage(Relation index, Buffer *buf, Page *page, int flags)
|
||||||
{
|
{
|
||||||
BTPageOpaque opaque;
|
BTPageOpaque opaque;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.13 1997/09/08 02:21:01 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.14 1997/09/08 21:41:31 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -347,7 +347,7 @@ _bt_checkforkeys(IndexScanDesc scan, IndexTuple itup, Size keysz)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool
|
bool
|
||||||
_bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size * keysok)
|
_bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok)
|
||||||
{
|
{
|
||||||
BTScanOpaque so = (BTScanOpaque) scan->opaque;
|
BTScanOpaque so = (BTScanOpaque) scan->opaque;
|
||||||
Size keysz = so->numberOfKeys;
|
Size keysz = so->numberOfKeys;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.10 1997/09/08 20:54:32 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.11 1997/09/08 21:41:37 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -87,7 +87,7 @@ rt_bigbox_size(BOX *a, float *size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
POLYGON *
|
POLYGON *
|
||||||
rt_poly_union(POLYGON * a, POLYGON * b)
|
rt_poly_union(POLYGON *a, POLYGON *b)
|
||||||
{
|
{
|
||||||
POLYGON *p;
|
POLYGON *p;
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ rt_poly_union(POLYGON * a, POLYGON * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rt_poly_size(POLYGON * a, float *size)
|
rt_poly_size(POLYGON *a, float *size)
|
||||||
{
|
{
|
||||||
double xdim,
|
double xdim,
|
||||||
ydim;
|
ydim;
|
||||||
@ -129,7 +129,7 @@ rt_poly_size(POLYGON * a, float *size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
POLYGON *
|
POLYGON *
|
||||||
rt_poly_inter(POLYGON * a, POLYGON * b)
|
rt_poly_inter(POLYGON *a, POLYGON *b)
|
||||||
{
|
{
|
||||||
POLYGON *p;
|
POLYGON *p;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.16 1997/09/08 20:54:33 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.17 1997/09/08 21:41:39 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -40,38 +40,38 @@ typedef struct SPLITVEC
|
|||||||
OffsetNumber *spl_right;
|
OffsetNumber *spl_right;
|
||||||
int spl_nright;
|
int spl_nright;
|
||||||
char *spl_rdatum;
|
char *spl_rdatum;
|
||||||
} SPLITVEC;
|
} SPLITVEC;
|
||||||
|
|
||||||
typedef struct RTSTATE
|
typedef struct RTSTATE
|
||||||
{
|
{
|
||||||
func_ptr unionFn; /* union function */
|
func_ptr unionFn; /* union function */
|
||||||
func_ptr sizeFn; /* size function */
|
func_ptr sizeFn; /* size function */
|
||||||
func_ptr interFn; /* intersection function */
|
func_ptr interFn; /* intersection function */
|
||||||
} 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);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -81,9 +81,9 @@ rtbuild(Relation heap,
|
|||||||
AttrNumber *attnum,
|
AttrNumber *attnum,
|
||||||
IndexStrategy istrat,
|
IndexStrategy istrat,
|
||||||
uint16 pcount,
|
uint16 pcount,
|
||||||
Datum * params,
|
Datum *params,
|
||||||
FuncIndexInfo * finfo,
|
FuncIndexInfo *finfo,
|
||||||
PredInfo * predInfo)
|
PredInfo *predInfo)
|
||||||
{
|
{
|
||||||
HeapScanDesc scan;
|
HeapScanDesc scan;
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
@ -305,7 +305,7 @@ rtbuild(Relation heap,
|
|||||||
* It doesn't do any work; just locks the relation and passes the buck.
|
* It doesn't do any work; just locks the relation and passes the buck.
|
||||||
*/
|
*/
|
||||||
InsertIndexResult
|
InsertIndexResult
|
||||||
rtinsert(Relation r, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
rtinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
||||||
{
|
{
|
||||||
InsertIndexResult res;
|
InsertIndexResult res;
|
||||||
IndexTuple itup;
|
IndexTuple itup;
|
||||||
@ -324,7 +324,7 @@ rtinsert(Relation r, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation h
|
|||||||
}
|
}
|
||||||
|
|
||||||
static InsertIndexResult
|
static InsertIndexResult
|
||||||
rtdoinsert(Relation r, IndexTuple itup, RTSTATE * rtstate)
|
rtdoinsert(Relation r, IndexTuple itup, RTSTATE *rtstate)
|
||||||
{
|
{
|
||||||
Page page;
|
Page page;
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
@ -409,10 +409,10 @@ rtdoinsert(Relation r, IndexTuple itup, RTSTATE * rtstate)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
rttighten(Relation r,
|
rttighten(Relation r,
|
||||||
RTSTACK * stk,
|
RTSTACK *stk,
|
||||||
char *datum,
|
char *datum,
|
||||||
int att_size,
|
int att_size,
|
||||||
RTSTATE * rtstate)
|
RTSTATE *rtstate)
|
||||||
{
|
{
|
||||||
char *oldud;
|
char *oldud;
|
||||||
char *tdatum;
|
char *tdatum;
|
||||||
@ -483,9 +483,9 @@ rttighten(Relation r,
|
|||||||
static InsertIndexResult
|
static InsertIndexResult
|
||||||
dosplit(Relation r,
|
dosplit(Relation r,
|
||||||
Buffer buffer,
|
Buffer buffer,
|
||||||
RTSTACK * stack,
|
RTSTACK *stack,
|
||||||
IndexTuple itup,
|
IndexTuple itup,
|
||||||
RTSTATE * rtstate)
|
RTSTATE *rtstate)
|
||||||
{
|
{
|
||||||
Page p;
|
Page p;
|
||||||
Buffer leftbuf,
|
Buffer leftbuf,
|
||||||
@ -614,9 +614,9 @@ dosplit(Relation r,
|
|||||||
|
|
||||||
tupDesc = r->rd_att;
|
tupDesc = r->rd_att;
|
||||||
ltup = (IndexTuple) index_formtuple(tupDesc,
|
ltup = (IndexTuple) index_formtuple(tupDesc,
|
||||||
(Datum *) & (v.spl_ldatum), isnull);
|
(Datum *) &(v.spl_ldatum), isnull);
|
||||||
rtup = (IndexTuple) index_formtuple(tupDesc,
|
rtup = (IndexTuple) index_formtuple(tupDesc,
|
||||||
(Datum *) & (v.spl_rdatum), isnull);
|
(Datum *) &(v.spl_rdatum), isnull);
|
||||||
pfree(isnull);
|
pfree(isnull);
|
||||||
|
|
||||||
/* set pointers to new child pages in the internal index tuples */
|
/* set pointers to new child pages in the internal index tuples */
|
||||||
@ -633,10 +633,10 @@ dosplit(Relation r,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
rtintinsert(Relation r,
|
rtintinsert(Relation r,
|
||||||
RTSTACK * stk,
|
RTSTACK *stk,
|
||||||
IndexTuple ltup,
|
IndexTuple ltup,
|
||||||
IndexTuple rtup,
|
IndexTuple rtup,
|
||||||
RTSTATE * rtstate)
|
RTSTATE *rtstate)
|
||||||
{
|
{
|
||||||
IndexTuple old;
|
IndexTuple old;
|
||||||
Buffer b;
|
Buffer b;
|
||||||
@ -714,9 +714,9 @@ rtnewroot(Relation r, IndexTuple lt, IndexTuple rt)
|
|||||||
static void
|
static void
|
||||||
picksplit(Relation r,
|
picksplit(Relation r,
|
||||||
Page page,
|
Page page,
|
||||||
SPLITVEC * v,
|
SPLITVEC *v,
|
||||||
IndexTuple itup,
|
IndexTuple itup,
|
||||||
RTSTATE * rtstate)
|
RTSTATE *rtstate)
|
||||||
{
|
{
|
||||||
OffsetNumber maxoff;
|
OffsetNumber maxoff;
|
||||||
OffsetNumber i,
|
OffsetNumber i,
|
||||||
@ -900,7 +900,7 @@ RTInitBuffer(Buffer b, uint32 f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static OffsetNumber
|
static OffsetNumber
|
||||||
choose(Relation r, Page p, IndexTuple it, RTSTATE * rtstate)
|
choose(Relation r, Page p, IndexTuple it, RTSTATE *rtstate)
|
||||||
{
|
{
|
||||||
OffsetNumber maxoff;
|
OffsetNumber maxoff;
|
||||||
OffsetNumber i;
|
OffsetNumber i;
|
||||||
@ -944,7 +944,7 @@ nospace(Page p, IndexTuple it)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
freestack(RTSTACK * s)
|
freestack(RTSTACK *s)
|
||||||
{
|
{
|
||||||
RTSTACK *p;
|
RTSTACK *p;
|
||||||
|
|
||||||
@ -986,7 +986,7 @@ rtdelete(Relation r, ItemPointer tid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
initRtstate(RTSTATE * rtstate, Relation index)
|
initRtstate(RTSTATE *rtstate, Relation index)
|
||||||
{
|
{
|
||||||
RegProcedure union_proc,
|
RegProcedure union_proc,
|
||||||
size_proc,
|
size_proc,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.12 1997/09/08 02:21:08 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.13 1997/09/08 21:41:40 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -34,7 +34,7 @@ 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,
|
||||||
@ -54,7 +54,7 @@ typedef struct RTScanListData
|
|||||||
{
|
{
|
||||||
IndexScanDesc rtsl_scan;
|
IndexScanDesc rtsl_scan;
|
||||||
struct RTScanListData *rtsl_next;
|
struct RTScanListData *rtsl_next;
|
||||||
} RTScanListData;
|
} RTScanListData;
|
||||||
|
|
||||||
typedef RTScanListData *RTScanList;
|
typedef RTScanListData *RTScanList;
|
||||||
|
|
||||||
@ -421,7 +421,7 @@ adjustiptr(IndexScanDesc s,
|
|||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
adjuststack(RTSTACK * stk,
|
adjuststack(RTSTACK *stk,
|
||||||
BlockNumber blkno,
|
BlockNumber blkno,
|
||||||
OffsetNumber offnum)
|
OffsetNumber offnum)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.12 1997/09/08 20:54:36 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.13 1997/09/08 21:41:42 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
|
||||||
@ -134,7 +134,7 @@ SetRecoveryCheckingEnabled(bool state)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool /* true/false: does transaction id have
|
static bool /* true/false: does transaction id have
|
||||||
* specified status? */
|
* specified status? */
|
||||||
TransactionLogTest(TransactionId transactionId, /* transaction id to test */
|
TransactionLogTest(TransactionId transactionId, /* transaction id to test */
|
||||||
XidStatus status) /* transaction status */
|
XidStatus status) /* transaction status */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.12 1997/09/08 20:54:37 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.13 1997/09/08 21:41:46 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This file contains support functions for the high
|
* This file contains support functions for the high
|
||||||
@ -111,7 +111,7 @@ TransComputeBlockNumber(Relation relation, /* relation to test */
|
|||||||
static XidStatus
|
static XidStatus
|
||||||
TransBlockGetLastTransactionIdStatus(Block tblock,
|
TransBlockGetLastTransactionIdStatus(Block tblock,
|
||||||
TransactionId baseXid,
|
TransactionId baseXid,
|
||||||
TransactionId * returnXidP)
|
TransactionId *returnXidP)
|
||||||
{
|
{
|
||||||
Index index;
|
Index index;
|
||||||
Index maxIndex;
|
Index maxIndex;
|
||||||
@ -392,7 +392,7 @@ XidStatus
|
|||||||
TransBlockNumberGetXidStatus(Relation relation,
|
TransBlockNumberGetXidStatus(Relation relation,
|
||||||
BlockNumber blockNumber,
|
BlockNumber blockNumber,
|
||||||
TransactionId xid,
|
TransactionId xid,
|
||||||
bool * failP)
|
bool *failP)
|
||||||
{
|
{
|
||||||
Buffer buffer; /* buffer associated with block */
|
Buffer buffer; /* buffer associated with block */
|
||||||
Block block; /* block containing xstatus */
|
Block block; /* block containing xstatus */
|
||||||
@ -449,7 +449,7 @@ TransBlockNumberSetXidStatus(Relation relation,
|
|||||||
BlockNumber blockNumber,
|
BlockNumber blockNumber,
|
||||||
TransactionId xid,
|
TransactionId xid,
|
||||||
XidStatus xstatus,
|
XidStatus xstatus,
|
||||||
bool * failP)
|
bool *failP)
|
||||||
{
|
{
|
||||||
Buffer buffer; /* buffer associated with block */
|
Buffer buffer; /* buffer associated with block */
|
||||||
Block block; /* block containing xstatus */
|
Block block; /* block containing xstatus */
|
||||||
@ -502,7 +502,7 @@ AbsoluteTime
|
|||||||
TransBlockNumberGetCommitTime(Relation relation,
|
TransBlockNumberGetCommitTime(Relation relation,
|
||||||
BlockNumber blockNumber,
|
BlockNumber blockNumber,
|
||||||
TransactionId xid,
|
TransactionId xid,
|
||||||
bool * failP)
|
bool *failP)
|
||||||
{
|
{
|
||||||
Buffer buffer; /* buffer associated with block */
|
Buffer buffer; /* buffer associated with block */
|
||||||
Block block; /* block containing commit time */
|
Block block; /* block containing commit time */
|
||||||
@ -563,7 +563,7 @@ TransBlockNumberSetCommitTime(Relation relation,
|
|||||||
BlockNumber blockNumber,
|
BlockNumber blockNumber,
|
||||||
TransactionId xid,
|
TransactionId xid,
|
||||||
AbsoluteTime xtime,
|
AbsoluteTime xtime,
|
||||||
bool * failP)
|
bool *failP)
|
||||||
{
|
{
|
||||||
Buffer buffer; /* buffer associated with block */
|
Buffer buffer; /* buffer associated with block */
|
||||||
Block block; /* block containing commit time */
|
Block block; /* block containing commit time */
|
||||||
@ -618,7 +618,7 @@ void
|
|||||||
TransGetLastRecordedTransaction(Relation relation,
|
TransGetLastRecordedTransaction(Relation relation,
|
||||||
TransactionId xid, /* return: transaction
|
TransactionId xid, /* return: transaction
|
||||||
* id */
|
* id */
|
||||||
bool * failP)
|
bool *failP)
|
||||||
{
|
{
|
||||||
BlockNumber blockNumber; /* block number */
|
BlockNumber blockNumber; /* block number */
|
||||||
Buffer buffer; /* buffer associated with block */
|
Buffer buffer; /* buffer associated with block */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.11 1997/09/08 02:21:21 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.12 1997/09/08 21:41:49 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -20,12 +20,12 @@
|
|||||||
#include <access/heapam.h>
|
#include <access/heapam.h>
|
||||||
#include <catalog/catname.h>
|
#include <catalog/catname.h>
|
||||||
|
|
||||||
static void GetNewObjectIdBlock(Oid * oid_return, int oid_block_size);
|
static void GetNewObjectIdBlock(Oid *oid_return, int oid_block_size);
|
||||||
static void VariableRelationGetNextOid(Oid * oid_return);
|
static void VariableRelationGetNextOid(Oid *oid_return);
|
||||||
static void VariableRelationGetNextXid(TransactionId * xidP);
|
static void VariableRelationGetNextXid(TransactionId *xidP);
|
||||||
static void VariableRelationPutLastXid(TransactionId xid);
|
static void VariableRelationPutLastXid(TransactionId xid);
|
||||||
static void VariableRelationPutNextOid(Oid * oidP);
|
static void VariableRelationPutNextOid(Oid *oidP);
|
||||||
static void VariableRelationGetLastXid(TransactionId * xidP);
|
static void VariableRelationGetLastXid(TransactionId *xidP);
|
||||||
|
|
||||||
/* ---------------------
|
/* ---------------------
|
||||||
* spin lock for oid generation
|
* spin lock for oid generation
|
||||||
@ -43,7 +43,7 @@ int OidGenLockId;
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
VariableRelationGetNextXid(TransactionId * xidP)
|
VariableRelationGetNextXid(TransactionId *xidP)
|
||||||
{
|
{
|
||||||
Buffer buf;
|
Buffer buf;
|
||||||
VariableRelationContents var;
|
VariableRelationContents var;
|
||||||
@ -85,7 +85,7 @@ VariableRelationGetNextXid(TransactionId * xidP)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
VariableRelationGetLastXid(TransactionId * xidP)
|
VariableRelationGetLastXid(TransactionId *xidP)
|
||||||
{
|
{
|
||||||
Buffer buf;
|
Buffer buf;
|
||||||
VariableRelationContents var;
|
VariableRelationContents var;
|
||||||
@ -217,7 +217,7 @@ VariableRelationPutLastXid(TransactionId xid)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
VariableRelationGetNextOid(Oid * oid_return)
|
VariableRelationGetNextOid(Oid *oid_return)
|
||||||
{
|
{
|
||||||
Buffer buf;
|
Buffer buf;
|
||||||
VariableRelationContents var;
|
VariableRelationContents var;
|
||||||
@ -287,7 +287,7 @@ VariableRelationGetNextOid(Oid * oid_return)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
VariableRelationPutNextOid(Oid * oidP)
|
VariableRelationPutNextOid(Oid *oidP)
|
||||||
{
|
{
|
||||||
Buffer buf;
|
Buffer buf;
|
||||||
VariableRelationContents var;
|
VariableRelationContents var;
|
||||||
@ -387,7 +387,7 @@ static int prefetched_xid_count = 0;
|
|||||||
static TransactionId next_prefetched_xid;
|
static TransactionId next_prefetched_xid;
|
||||||
|
|
||||||
void
|
void
|
||||||
GetNewTransactionId(TransactionId * xid)
|
GetNewTransactionId(TransactionId *xid)
|
||||||
{
|
{
|
||||||
TransactionId nextid;
|
TransactionId nextid;
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ UpdateLastCommittedXid(TransactionId xid)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
GetNewObjectIdBlock(Oid * oid_return, /* place to return the new object
|
GetNewObjectIdBlock(Oid *oid_return, /* place to return the new object
|
||||||
* id */
|
* id */
|
||||||
int oid_block_size) /* number of oids desired */
|
int oid_block_size) /* number of oids desired */
|
||||||
{
|
{
|
||||||
@ -558,7 +558,7 @@ static int prefetched_oid_count = 0;
|
|||||||
static Oid next_prefetched_oid;
|
static Oid next_prefetched_oid;
|
||||||
|
|
||||||
void
|
void
|
||||||
GetNewObjectId(Oid * oid_return)/* place to return the new object id */
|
GetNewObjectId(Oid *oid_return) /* place to return the new object id */
|
||||||
{
|
{
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* if we run out of prefetched oids, then we get some
|
* if we run out of prefetched oids, then we get some
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.15 1997/09/08 02:21:22 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.16 1997/09/08 21:41:52 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Transaction aborts can now occur two ways:
|
* Transaction aborts can now occur two ways:
|
||||||
@ -202,9 +202,9 @@ TransactionState CurrentTransactionState =
|
|||||||
* V1 transaction system. -cim 3/18/90
|
* V1 transaction system. -cim 3/18/90
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
TransactionId DisabledTransactionId = (TransactionId) - 1;
|
TransactionId DisabledTransactionId = (TransactionId) -1;
|
||||||
|
|
||||||
CommandId DisabledCommandId = (CommandId) - 1;
|
CommandId DisabledCommandId = (CommandId) -1;
|
||||||
|
|
||||||
AbsoluteTime DisabledStartTime = (AbsoluteTime) BIG_ABSTIME; /* 1073741823; */
|
AbsoluteTime DisabledStartTime = (AbsoluteTime) BIG_ABSTIME; /* 1073741823; */
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.9 1997/09/08 02:21:24 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.10 1997/09/08 21:41:56 momjian Exp $
|
||||||
*
|
*
|
||||||
* OLD COMMENTS
|
* OLD COMMENTS
|
||||||
* XXX WARNING
|
* XXX WARNING
|
||||||
@ -73,7 +73,7 @@ xidout(TransactionId transactionId)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
StoreInvalidTransactionId(TransactionId * destination)
|
StoreInvalidTransactionId(TransactionId *destination)
|
||||||
{
|
{
|
||||||
*destination = NullTransactionId;
|
*destination = NullTransactionId;
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ StoreInvalidTransactionId(TransactionId * destination)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TransactionIdStore(TransactionId transactionId,
|
TransactionIdStore(TransactionId transactionId,
|
||||||
TransactionId * destination)
|
TransactionId *destination)
|
||||||
{
|
{
|
||||||
*destination = transactionId;
|
*destination = transactionId;
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ xideq(TransactionId xid1, TransactionId xid2)
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
void
|
void
|
||||||
TransactionIdIncrement(TransactionId * transactionId)
|
TransactionIdIncrement(TransactionId *transactionId)
|
||||||
{
|
{
|
||||||
|
|
||||||
(*transactionId)++;
|
(*transactionId)++;
|
||||||
@ -150,7 +150,7 @@ TransactionIdIncrement(TransactionId * transactionId)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TransactionIdAdd(TransactionId * xid, int value)
|
TransactionIdAdd(TransactionId *xid, int value)
|
||||||
{
|
{
|
||||||
*xid += value;
|
*xid += value;
|
||||||
return;
|
return;
|
||||||
|
@ -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.24 1997/09/08 20:54:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.25 1997/09/08 21:42:01 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -108,7 +108,7 @@ static hashnode *AddStr(char *str, int strlength, int mderef);
|
|||||||
static AttributeTupleForm AllocateAttribute(void);
|
static AttributeTupleForm AllocateAttribute(void);
|
||||||
static bool BootstrapAlreadySeen(Oid id);
|
static bool BootstrapAlreadySeen(Oid id);
|
||||||
static int CompHash(char *str, int len);
|
static int CompHash(char *str, int len);
|
||||||
static hashnode *FindStr(char *str, int length, hashnode * mderef);
|
static hashnode *FindStr(char *str, int length, hashnode *mderef);
|
||||||
static int gettype(char *type);
|
static int gettype(char *type);
|
||||||
static void cleanup(void);
|
static void cleanup(void);
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ typedef struct _IndexList
|
|||||||
FuncIndexInfo *il_finfo;
|
FuncIndexInfo *il_finfo;
|
||||||
PredInfo *il_predInfo;
|
PredInfo *il_predInfo;
|
||||||
struct _IndexList *il_next;
|
struct _IndexList *il_next;
|
||||||
} IndexList;
|
} IndexList;
|
||||||
|
|
||||||
static IndexList *ILHead = (IndexList *) NULL;
|
static IndexList *ILHead = (IndexList *) NULL;
|
||||||
|
|
||||||
@ -1002,7 +1002,7 @@ CompHash(char *str, int len)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static hashnode *
|
static hashnode *
|
||||||
FindStr(char *str, int length, hashnode * mderef)
|
FindStr(char *str, int length, hashnode *mderef)
|
||||||
{
|
{
|
||||||
hashnode *node;
|
hashnode *node;
|
||||||
|
|
||||||
@ -1113,9 +1113,9 @@ index_register(char *heap,
|
|||||||
int natts,
|
int natts,
|
||||||
AttrNumber *attnos,
|
AttrNumber *attnos,
|
||||||
uint16 nparams,
|
uint16 nparams,
|
||||||
Datum * params,
|
Datum *params,
|
||||||
FuncIndexInfo * finfo,
|
FuncIndexInfo *finfo,
|
||||||
PredInfo * predInfo)
|
PredInfo *predInfo)
|
||||||
{
|
{
|
||||||
Datum *v;
|
Datum *v;
|
||||||
IndexList *newind;
|
IndexList *newind;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.9 1997/09/08 02:21:33 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.10 1997/09/08 21:42:12 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -183,7 +183,7 @@ fillatt(TupleDesc tupleDesc)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(*attributeP)->attnum = (int16)++ i;
|
(*attributeP)->attnum = (int16) ++i;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the attr is a set before messing with the length
|
* Check if the attr is a set before messing with the length
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.27 1997/09/08 20:54:54 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.28 1997/09/08 21:42:16 momjian Exp $
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
* heap_creatr() - Create an uncataloged heap relation
|
* heap_creatr() - Create an uncataloged heap relation
|
||||||
@ -164,7 +164,7 @@ typedef struct tempRelList
|
|||||||
int num; /* number of temporary relations */
|
int num; /* number of temporary relations */
|
||||||
int size; /* size of space allocated for the rels
|
int size; /* size of space allocated for the rels
|
||||||
* array */
|
* array */
|
||||||
} TempRelList;
|
} TempRelList;
|
||||||
|
|
||||||
#define TEMP_REL_LIST_SIZE 32
|
#define TEMP_REL_LIST_SIZE 32
|
||||||
|
|
||||||
@ -1518,10 +1518,10 @@ DestroyTempRels(void)
|
|||||||
tempRels = NULL;
|
tempRels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern List *flatten_tlist(List * tlist);
|
extern List *flatten_tlist(List *tlist);
|
||||||
extern List *
|
extern List *
|
||||||
pg_plan(char *query_string, Oid * typev, int nargs,
|
pg_plan(char *query_string, Oid *typev, int nargs,
|
||||||
QueryTreeList ** queryListP, CommandDest dest);
|
QueryTreeList **queryListP, CommandDest dest);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
StoreAttrDefault(Relation rel, AttrDefault *attrdef)
|
StoreAttrDefault(Relation rel, AttrDefault *attrdef)
|
||||||
@ -1598,7 +1598,7 @@ start:;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
StoreRelCheck(Relation rel, ConstrCheck * check)
|
StoreRelCheck(Relation rel, ConstrCheck *check)
|
||||||
{
|
{
|
||||||
char str[MAX_PARSE_BUFFER];
|
char str[MAX_PARSE_BUFFER];
|
||||||
QueryTreeList *queryTree_list;
|
QueryTreeList *queryTree_list;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.21 1997/09/08 02:21:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.22 1997/09/08 21:42:18 momjian Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -67,10 +67,10 @@ static Oid
|
|||||||
RelationNameGetObjectId(char *relationName, Relation pg_class,
|
RelationNameGetObjectId(char *relationName, Relation pg_class,
|
||||||
bool setHasIndexAttribute);
|
bool setHasIndexAttribute);
|
||||||
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);
|
||||||
@ -83,14 +83,14 @@ 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);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
* sysatts is a structure containing attribute tuple forms
|
* sysatts is a structure containing attribute tuple forms
|
||||||
@ -269,7 +269,7 @@ GetHeapRelationOid(char *heapRelationName, char *indexRelationName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static TupleDesc
|
static TupleDesc
|
||||||
BuildFuncTupleDesc(FuncIndexInfo * funcInfo)
|
BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
|
||||||
{
|
{
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
TupleDesc funcTupDesc;
|
TupleDesc funcTupDesc;
|
||||||
@ -334,7 +334,7 @@ BuildFuncTupleDesc(FuncIndexInfo * funcInfo)
|
|||||||
static TupleDesc
|
static TupleDesc
|
||||||
ConstructTupleDescriptor(Oid heapoid,
|
ConstructTupleDescriptor(Oid heapoid,
|
||||||
Relation heapRelation,
|
Relation heapRelation,
|
||||||
List * attributeList,
|
List *attributeList,
|
||||||
int numatts,
|
int numatts,
|
||||||
AttrNumber attNums[])
|
AttrNumber attNums[])
|
||||||
{
|
{
|
||||||
@ -777,12 +777,12 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
|
|||||||
static void
|
static void
|
||||||
UpdateIndexRelation(Oid indexoid,
|
UpdateIndexRelation(Oid indexoid,
|
||||||
Oid heapoid,
|
Oid heapoid,
|
||||||
FuncIndexInfo * funcInfo,
|
FuncIndexInfo *funcInfo,
|
||||||
int natts,
|
int natts,
|
||||||
AttrNumber attNums[],
|
AttrNumber attNums[],
|
||||||
Oid classOids[],
|
Oid classOids[],
|
||||||
Node * predicate,
|
Node *predicate,
|
||||||
List * attributeList,
|
List *attributeList,
|
||||||
bool islossy,
|
bool islossy,
|
||||||
bool unique)
|
bool unique)
|
||||||
{
|
{
|
||||||
@ -901,7 +901,7 @@ UpdateIndexRelation(Oid indexoid,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
UpdateIndexPredicate(Oid indexoid, Node * oldPred, Node * predicate)
|
UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
|
||||||
{
|
{
|
||||||
Node *newPred;
|
Node *newPred;
|
||||||
char *predString;
|
char *predString;
|
||||||
@ -1065,15 +1065,15 @@ InitIndexStrategy(int numatts,
|
|||||||
void
|
void
|
||||||
index_create(char *heapRelationName,
|
index_create(char *heapRelationName,
|
||||||
char *indexRelationName,
|
char *indexRelationName,
|
||||||
FuncIndexInfo * funcInfo,
|
FuncIndexInfo *funcInfo,
|
||||||
List * attributeList,
|
List *attributeList,
|
||||||
Oid accessMethodObjectId,
|
Oid accessMethodObjectId,
|
||||||
int numatts,
|
int numatts,
|
||||||
AttrNumber attNums[],
|
AttrNumber attNums[],
|
||||||
Oid classObjectId[],
|
Oid classObjectId[],
|
||||||
uint16 parameterCount,
|
uint16 parameterCount,
|
||||||
Datum * parameter,
|
Datum *parameter,
|
||||||
Node * predicate,
|
Node *predicate,
|
||||||
bool islossy,
|
bool islossy,
|
||||||
bool unique)
|
bool unique)
|
||||||
{
|
{
|
||||||
@ -1321,7 +1321,7 @@ FormIndexDatum(int numberOfAttributes,
|
|||||||
HeapTuple heapTuple,
|
HeapTuple heapTuple,
|
||||||
TupleDesc heapDescriptor,
|
TupleDesc heapDescriptor,
|
||||||
Buffer buffer,
|
Buffer buffer,
|
||||||
Datum * datum,
|
Datum *datum,
|
||||||
char *nullv,
|
char *nullv,
|
||||||
FuncIndexInfoPtr fInfo)
|
FuncIndexInfoPtr fInfo)
|
||||||
{
|
{
|
||||||
@ -1379,7 +1379,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
|||||||
char nulls[Natts_pg_class];
|
char nulls[Natts_pg_class];
|
||||||
char replace[Natts_pg_class];
|
char replace[Natts_pg_class];
|
||||||
|
|
||||||
fmgr_info(ObjectIdEqualRegProcedure, (func_ptr *) & key[0].sk_func,
|
fmgr_info(ObjectIdEqualRegProcedure, (func_ptr *) &key[0].sk_func,
|
||||||
&key[0].sk_nargs);
|
&key[0].sk_nargs);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
@ -1501,8 +1501,8 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
|||||||
* -------------------------
|
* -------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
FillDummyExprContext(ExprContext * econtext,
|
FillDummyExprContext(ExprContext *econtext,
|
||||||
TupleTableSlot * slot,
|
TupleTableSlot *slot,
|
||||||
TupleDesc tupdesc,
|
TupleDesc tupdesc,
|
||||||
Buffer buffer)
|
Buffer buffer)
|
||||||
{
|
{
|
||||||
@ -1532,7 +1532,7 @@ DefaultBuild(Relation heapRelation,
|
|||||||
uint16 parameterCount, /* not used */
|
uint16 parameterCount, /* not used */
|
||||||
Datum parameter[], /* not used */
|
Datum parameter[], /* not used */
|
||||||
FuncIndexInfoPtr funcInfo,
|
FuncIndexInfoPtr funcInfo,
|
||||||
PredInfo * predInfo)
|
PredInfo *predInfo)
|
||||||
{
|
{
|
||||||
HeapScanDesc scan;
|
HeapScanDesc scan;
|
||||||
HeapTuple heapTuple;
|
HeapTuple heapTuple;
|
||||||
@ -1732,9 +1732,9 @@ index_build(Relation heapRelation,
|
|||||||
int numberOfAttributes,
|
int numberOfAttributes,
|
||||||
AttrNumber attributeNumber[],
|
AttrNumber attributeNumber[],
|
||||||
uint16 parameterCount,
|
uint16 parameterCount,
|
||||||
Datum * parameter,
|
Datum *parameter,
|
||||||
FuncIndexInfo * funcInfo,
|
FuncIndexInfo *funcInfo,
|
||||||
PredInfo * predInfo)
|
PredInfo *predInfo)
|
||||||
{
|
{
|
||||||
RegProcedure procedure;
|
RegProcedure procedure;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.14 1997/09/08 20:55:07 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.15 1997/09/08 21:42:20 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -88,7 +88,7 @@ CatalogOpenIndices(int nIndices, char *names[], Relation idescs[])
|
|||||||
* This is the inverse routine to CatalogOpenIndices()
|
* This is the inverse routine to CatalogOpenIndices()
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
CatalogCloseIndices(int nIndices, Relation * idescs)
|
CatalogCloseIndices(int nIndices, Relation *idescs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ CatalogCloseIndices(int nIndices, Relation * idescs)
|
|||||||
* each catalog index.
|
* each catalog index.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
CatalogIndexInsert(Relation * idescs,
|
CatalogIndexInsert(Relation *idescs,
|
||||||
int nIndices,
|
int nIndices,
|
||||||
Relation heapRelation,
|
Relation heapRelation,
|
||||||
HeapTuple heapTuple)
|
HeapTuple heapTuple)
|
||||||
@ -345,7 +345,7 @@ HeapTuple
|
|||||||
ProcedureNameIndexScan(Relation heapRelation,
|
ProcedureNameIndexScan(Relation heapRelation,
|
||||||
char *procName,
|
char *procName,
|
||||||
int nargs,
|
int nargs,
|
||||||
Oid * argTypes)
|
Oid *argTypes)
|
||||||
{
|
{
|
||||||
Relation idesc;
|
Relation idesc;
|
||||||
ScanKeyData skey;
|
ScanKeyData skey;
|
||||||
@ -435,7 +435,7 @@ ProcedureNameIndexScan(Relation heapRelation,
|
|||||||
|
|
||||||
|
|
||||||
HeapTuple
|
HeapTuple
|
||||||
ProcedureSrcIndexScan(Relation heapRelation, text * procSrc)
|
ProcedureSrcIndexScan(Relation heapRelation, text *procSrc)
|
||||||
{
|
{
|
||||||
Relation idesc;
|
Relation idesc;
|
||||||
IndexScanDesc sd;
|
IndexScanDesc sd;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.7 1997/09/08 02:21:46 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.8 1997/09/08 21:42:22 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -268,7 +268,7 @@ AggregateCreate(char *aggName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool * isNull)
|
AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
|
||||||
{
|
{
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
Relation aggRel;
|
Relation aggRel;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.7 1997/09/08 02:21:50 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.8 1997/09/08 21:42:23 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -52,7 +52,7 @@ ProcedureCreate(char *procedureName,
|
|||||||
int32 perbyte_cpu,
|
int32 perbyte_cpu,
|
||||||
int32 percall_cpu,
|
int32 percall_cpu,
|
||||||
int32 outin_ratio,
|
int32 outin_ratio,
|
||||||
List * argList,
|
List *argList,
|
||||||
CommandDest dest)
|
CommandDest dest)
|
||||||
{
|
{
|
||||||
register i;
|
register i;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.9 1997/09/08 02:21:51 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.10 1997/09/08 21:42:24 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -47,7 +47,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc,
|
|||||||
static Oid
|
static Oid
|
||||||
TypeGetWithOpenRelation(Relation pg_type_desc,
|
TypeGetWithOpenRelation(Relation pg_type_desc,
|
||||||
char *typeName,
|
char *typeName,
|
||||||
bool * defined)
|
bool *defined)
|
||||||
{
|
{
|
||||||
HeapScanDesc scan;
|
HeapScanDesc scan;
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
@ -116,7 +116,7 @@ TypeGetWithOpenRelation(Relation pg_type_desc,
|
|||||||
*/
|
*/
|
||||||
Oid
|
Oid
|
||||||
TypeGet(char *typeName, /* name of type to be fetched */
|
TypeGet(char *typeName, /* name of type to be fetched */
|
||||||
bool * defined) /* has the type been defined? */
|
bool *defined) /* has the type been defined? */
|
||||||
{
|
{
|
||||||
Relation pg_type_desc;
|
Relation pg_type_desc;
|
||||||
Oid typeoid;
|
Oid typeoid;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.15 1997/09/08 02:22:01 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.16 1997/09/08 21:42:29 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
* The PortalExecutorHeapMemory crap needs to be eliminated
|
||||||
@ -255,7 +255,7 @@ void
|
|||||||
PerformAddAttribute(char *relationName,
|
PerformAddAttribute(char *relationName,
|
||||||
char *userName,
|
char *userName,
|
||||||
bool inherits,
|
bool inherits,
|
||||||
ColumnDef * colDef)
|
ColumnDef *colDef)
|
||||||
{
|
{
|
||||||
Relation relrdesc,
|
Relation relrdesc,
|
||||||
attrdesc;
|
attrdesc;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.32 1997/09/08 20:55:19 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.33 1997/09/08 21:42:30 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -42,8 +42,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/* non-export function prototypes */
|
/* non-export function prototypes */
|
||||||
static void CopyTo(Relation rel, bool binary, bool oids, FILE * fp, char *delim);
|
static void CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim);
|
||||||
static void CopyFrom(Relation rel, bool binary, bool oids, FILE * fp, char *delim);
|
static void CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim);
|
||||||
static Oid GetOutputFunction(Oid type);
|
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);
|
||||||
@ -51,17 +51,17 @@ 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);
|
||||||
|
|
||||||
#ifdef COPY_PATCH
|
#ifdef COPY_PATCH
|
||||||
static void CopyReadNewline(FILE * fp, int *newline);
|
static void CopyReadNewline(FILE *fp, int *newline);
|
||||||
static char *CopyReadAttribute(FILE * fp, bool * isnull, char *delim, int *newline);
|
static char *CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
static char *CopyReadAttribute(FILE * fp, bool * isnull, char *delim);
|
static char *CopyReadAttribute(FILE *fp, bool *isnull, char *delim);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
static void CopyAttributeOut(FILE * fp, char *string, char *delim);
|
static void CopyAttributeOut(FILE *fp, char *string, char *delim);
|
||||||
static int CountTuples(Relation relation);
|
static int CountTuples(Relation relation);
|
||||||
|
|
||||||
extern FILE *Pfout,
|
extern FILE *Pfout,
|
||||||
@ -197,7 +197,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CopyTo(Relation rel, bool binary, bool oids, FILE * fp, char *delim)
|
CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||||
{
|
{
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
HeapScanDesc scandesc;
|
HeapScanDesc scandesc;
|
||||||
@ -356,7 +356,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE * fp, char *delim)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CopyFrom(Relation rel, bool binary, bool oids, FILE * fp, char *delim)
|
CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||||
{
|
{
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
AttrNumber attr_count;
|
AttrNumber attr_count;
|
||||||
@ -648,17 +648,17 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE * fp, char *delim)
|
|||||||
switch (attr[i]->attlen)
|
switch (attr[i]->attlen)
|
||||||
{
|
{
|
||||||
case sizeof(char):
|
case sizeof(char):
|
||||||
values[i] = (Datum) * (unsigned char *) ptr;
|
values[i] = (Datum) *(unsigned char *) ptr;
|
||||||
ptr += sizeof(char);
|
ptr += sizeof(char);
|
||||||
break;
|
break;
|
||||||
case sizeof(short):
|
case sizeof(short):
|
||||||
ptr = (char *) SHORTALIGN(ptr);
|
ptr = (char *) SHORTALIGN(ptr);
|
||||||
values[i] = (Datum) * (unsigned short *) ptr;
|
values[i] = (Datum) *(unsigned short *) ptr;
|
||||||
ptr += sizeof(short);
|
ptr += sizeof(short);
|
||||||
break;
|
break;
|
||||||
case sizeof(int32):
|
case sizeof(int32):
|
||||||
ptr = (char *) INTALIGN(ptr);
|
ptr = (char *) INTALIGN(ptr);
|
||||||
values[i] = (Datum) * (uint32 *) ptr;
|
values[i] = (Datum) *(uint32 *) ptr;
|
||||||
ptr += sizeof(int32);
|
ptr += sizeof(int32);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -904,12 +904,12 @@ typedef struct rel_list
|
|||||||
{
|
{
|
||||||
Oid index_rel_oid;
|
Oid index_rel_oid;
|
||||||
struct rel_list *next;
|
struct rel_list *next;
|
||||||
} RelationList;
|
} RelationList;
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
RelationList *head,
|
RelationList *head,
|
||||||
*scan;
|
*scan;
|
||||||
@ -1002,7 +1002,7 @@ inString(char c, char *s)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
CopyReadNewline(FILE * fp, int *newline)
|
CopyReadNewline(FILE *fp, int *newline)
|
||||||
{
|
{
|
||||||
if (!*newline)
|
if (!*newline)
|
||||||
{
|
{
|
||||||
@ -1028,9 +1028,9 @@ CopyReadNewline(FILE * fp, int *newline)
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
#ifdef COPY_PATCH
|
#ifdef COPY_PATCH
|
||||||
CopyReadAttribute(FILE * fp, bool * isnull, char *delim, int *newline)
|
CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline)
|
||||||
#else
|
#else
|
||||||
CopyReadAttribute(FILE * fp, bool * isnull, char *delim)
|
CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
static char attribute[EXT_ATTLEN];
|
static char attribute[EXT_ATTLEN];
|
||||||
@ -1151,7 +1151,7 @@ CopyReadAttribute(FILE * fp, bool * isnull, char *delim)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CopyAttributeOut(FILE * fp, char *string, char *delim)
|
CopyAttributeOut(FILE *fp, char *string, char *delim)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
int is_array = false;
|
int is_array = false;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.16 1997/09/08 02:22:06 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.17 1997/09/08 21:42:33 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -35,9 +35,9 @@
|
|||||||
|
|
||||||
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);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
* DefineRelation --
|
* DefineRelation --
|
||||||
@ -45,7 +45,7 @@ static void StoreCatalogInheritance(Oid relationId, List * supers);
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
DefineRelation(CreateStmt * stmt)
|
DefineRelation(CreateStmt *stmt)
|
||||||
{
|
{
|
||||||
char *relname = palloc(NAMEDATALEN);
|
char *relname = palloc(NAMEDATALEN);
|
||||||
List *schema = stmt->tableElts;
|
List *schema = stmt->tableElts;
|
||||||
@ -280,7 +280,7 @@ RemoveRelation(char *name)
|
|||||||
* stud_emp {7:percent}
|
* stud_emp {7:percent}
|
||||||
*/
|
*/
|
||||||
static List *
|
static List *
|
||||||
MergeAttributes(List * schema, List * supers, List ** supconstr)
|
MergeAttributes(List *schema, List *supers, List **supconstr)
|
||||||
{
|
{
|
||||||
List *entry;
|
List *entry;
|
||||||
List *inhSchema = NIL;
|
List *inhSchema = NIL;
|
||||||
@ -459,7 +459,7 @@ MergeAttributes(List * schema, List * supers, List ** supconstr)
|
|||||||
* Updates the system catalogs with proper inheritance information.
|
* Updates the system catalogs with proper inheritance information.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
StoreCatalogInheritance(Oid relationId, List * supers)
|
StoreCatalogInheritance(Oid relationId, List *supers)
|
||||||
{
|
{
|
||||||
Relation relation;
|
Relation relation;
|
||||||
TupleDesc desc;
|
TupleDesc desc;
|
||||||
@ -640,7 +640,7 @@ again:
|
|||||||
* returns 1 if attribute already exists in schema, 0 otherwise.
|
* returns 1 if attribute already exists in schema, 0 otherwise.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
checkAttrExists(char *attributeName, char *attributeType, List * schema)
|
checkAttrExists(char *attributeName, char *attributeType, List *schema)
|
||||||
{
|
{
|
||||||
List *s;
|
List *s;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.15 1997/09/08 20:55:25 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.16 1997/09/08 21:42:35 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -39,18 +39,18 @@
|
|||||||
#define IsFuncIndex(ATTR_LIST) (((IndexElem*)lfirst(ATTR_LIST))->args!=NULL)
|
#define IsFuncIndex(ATTR_LIST) (((IndexElem*)lfirst(ATTR_LIST))->args!=NULL)
|
||||||
|
|
||||||
/* 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);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -70,11 +70,11 @@ void
|
|||||||
DefineIndex(char *heapRelationName,
|
DefineIndex(char *heapRelationName,
|
||||||
char *indexRelationName,
|
char *indexRelationName,
|
||||||
char *accessMethodName,
|
char *accessMethodName,
|
||||||
List * attributeList,
|
List *attributeList,
|
||||||
List * parameterList,
|
List *parameterList,
|
||||||
bool unique,
|
bool unique,
|
||||||
Expr * predicate,
|
Expr *predicate,
|
||||||
List * rangetable)
|
List *rangetable)
|
||||||
{
|
{
|
||||||
Oid *classObjectId;
|
Oid *classObjectId;
|
||||||
Oid accessMethodId;
|
Oid accessMethodId;
|
||||||
@ -223,7 +223,7 @@ DefineIndex(char *heapRelationName,
|
|||||||
* XXX
|
* XXX
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExtendIndex(char *indexRelationName, Expr * predicate, List * rangetable)
|
ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
|
||||||
{
|
{
|
||||||
Oid *classObjectId;
|
Oid *classObjectId;
|
||||||
Oid accessMethodId;
|
Oid accessMethodId;
|
||||||
@ -364,7 +364,7 @@ ExtendIndex(char *indexRelationName, Expr * predicate, List * rangetable)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CheckPredicate(List * predList, List * rangeTable, Oid baseRelOid)
|
CheckPredicate(List *predList, List *rangeTable, Oid baseRelOid)
|
||||||
{
|
{
|
||||||
List *item;
|
List *item;
|
||||||
|
|
||||||
@ -375,7 +375,7 @@ CheckPredicate(List * predList, List * rangeTable, Oid baseRelOid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CheckPredExpr(Node * predicate, List * rangeTable, Oid baseRelOid)
|
CheckPredExpr(Node *predicate, List *rangeTable, Oid baseRelOid)
|
||||||
{
|
{
|
||||||
List *clauses = NIL,
|
List *clauses = NIL,
|
||||||
*clause;
|
*clause;
|
||||||
@ -399,7 +399,7 @@ CheckPredExpr(Node * predicate, List * rangeTable, Oid baseRelOid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CheckPredClause(Expr * predicate, List * rangeTable, Oid baseRelOid)
|
CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid)
|
||||||
{
|
{
|
||||||
Var *pred_var;
|
Var *pred_var;
|
||||||
Const *pred_const;
|
Const *pred_const;
|
||||||
@ -421,10 +421,10 @@ CheckPredClause(Expr * predicate, List * rangeTable, Oid baseRelOid)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
FuncIndexArgs(IndexElem * funcIndex,
|
FuncIndexArgs(IndexElem *funcIndex,
|
||||||
AttrNumber *attNumP,
|
AttrNumber *attNumP,
|
||||||
Oid * argTypes,
|
Oid *argTypes,
|
||||||
Oid * opOidP,
|
Oid *opOidP,
|
||||||
Oid relId)
|
Oid relId)
|
||||||
{
|
{
|
||||||
List *rest;
|
List *rest;
|
||||||
@ -470,9 +470,9 @@ FuncIndexArgs(IndexElem * funcIndex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
NormIndexAttrs(List * attList, /* list of IndexElem's */
|
NormIndexAttrs(List *attList, /* list of IndexElem's */
|
||||||
AttrNumber *attNumP,
|
AttrNumber *attNumP,
|
||||||
Oid * opOidP,
|
Oid *opOidP,
|
||||||
Oid relId)
|
Oid relId)
|
||||||
{
|
{
|
||||||
List *rest;
|
List *rest;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.15 1997/09/08 02:22:09 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.16 1997/09/08 21:42:38 momjian Exp $
|
||||||
*
|
*
|
||||||
* DESCRIPTION
|
* DESCRIPTION
|
||||||
* The "DefineFoo" routines take the parse tree and pick out the
|
* The "DefineFoo" routines take the parse tree and pick out the
|
||||||
@ -53,8 +53,8 @@
|
|||||||
#include <tcop/dest.h>
|
#include <tcop/dest.h>
|
||||||
#include <catalog/pg_user.h>
|
#include <catalog/pg_user.h>
|
||||||
|
|
||||||
static char *defGetString(DefElem * def);
|
static char *defGetString(DefElem *def);
|
||||||
static int defGetTypeLength(DefElem * def);
|
static int defGetTypeLength(DefElem *def);
|
||||||
|
|
||||||
#define DEFAULT_TYPDELIM ','
|
#define DEFAULT_TYPDELIM ','
|
||||||
|
|
||||||
@ -80,8 +80,8 @@ case_translate_language_name(const char *input, char *output)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
compute_return_type(const Node * returnType,
|
compute_return_type(const Node *returnType,
|
||||||
char **prorettype_p, bool * returnsSet_p)
|
char **prorettype_p, bool *returnsSet_p)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
Examine the "returns" clause returnType of the CREATE FUNCTION statement
|
Examine the "returns" clause returnType of the CREATE FUNCTION statement
|
||||||
@ -106,9 +106,9 @@ compute_return_type(const Node * returnType,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
compute_full_attributes(const List * parameters, int32 * byte_pct_p,
|
compute_full_attributes(const List *parameters, int32 *byte_pct_p,
|
||||||
int32 * perbyte_cpu_p, int32 * percall_cpu_p,
|
int32 *perbyte_cpu_p, int32 *percall_cpu_p,
|
||||||
int32 * outin_ratio_p, bool * canCache_p)
|
int32 *outin_ratio_p, bool *canCache_p)
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
Interpret the parameters *parameters and return their contents as
|
Interpret the parameters *parameters and return their contents as
|
||||||
@ -210,7 +210,7 @@ interpret_AS_clause(const char languageName[], const char as[],
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
CreateFunction(ProcedureStmt * stmt, CommandDest dest)
|
CreateFunction(ProcedureStmt *stmt, CommandDest dest)
|
||||||
{
|
{
|
||||||
char *probin_str;
|
char *probin_str;
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ CreateFunction(ProcedureStmt * stmt, CommandDest dest)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
DefineOperator(char *oprName,
|
DefineOperator(char *oprName,
|
||||||
List * parameters)
|
List *parameters)
|
||||||
{
|
{
|
||||||
uint16 precedence = 0; /* operator precedence */
|
uint16 precedence = 0; /* operator precedence */
|
||||||
bool canHash = false;/* operator hashes */
|
bool canHash = false;/* operator hashes */
|
||||||
@ -461,7 +461,7 @@ DefineOperator(char *oprName,
|
|||||||
* ------------------
|
* ------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
DefineAggregate(char *aggName, List * parameters)
|
DefineAggregate(char *aggName, List *parameters)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *stepfunc1Name = NULL;
|
char *stepfunc1Name = NULL;
|
||||||
@ -570,7 +570,7 @@ DefineAggregate(char *aggName, List * parameters)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
DefineType(char *typeName, List * parameters)
|
DefineType(char *typeName, List *parameters)
|
||||||
{
|
{
|
||||||
int16 internalLength = 0; /* int2 */
|
int16 internalLength = 0; /* int2 */
|
||||||
int16 externalLength = 0; /* int2 */
|
int16 externalLength = 0; /* int2 */
|
||||||
@ -720,7 +720,7 @@ DefineType(char *typeName, List * parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
defGetString(DefElem * def)
|
defGetString(DefElem *def)
|
||||||
{
|
{
|
||||||
if (nodeTag(def->arg) != T_String)
|
if (nodeTag(def->arg) != T_String)
|
||||||
elog(WARN, "Define: \"%s\" = what?", def->defname);
|
elog(WARN, "Define: \"%s\" = what?", def->defname);
|
||||||
@ -728,7 +728,7 @@ defGetString(DefElem * def)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
defGetTypeLength(DefElem * def)
|
defGetTypeLength(DefElem *def)
|
||||||
{
|
{
|
||||||
if (nodeTag(def->arg) == T_Integer)
|
if (nodeTag(def->arg) == T_Integer)
|
||||||
return (intVal(def->arg));
|
return (intVal(def->arg));
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.12 1997/09/08 02:22:10 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.13 1997/09/08 21:42:40 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -32,9 +32,9 @@ typedef struct ExplainState
|
|||||||
bool printNodes; /* do nodeToString() instead */
|
bool printNodes; /* do nodeToString() instead */
|
||||||
/* other states */
|
/* other states */
|
||||||
List *rtable; /* range table */
|
List *rtable; /* range table */
|
||||||
} ExplainState;
|
} ExplainState;
|
||||||
|
|
||||||
static char *Explain_PlanToString(Plan * plan, ExplainState * es);
|
static char *Explain_PlanToString(Plan *plan, ExplainState *es);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ExplainQuery -
|
* ExplainQuery -
|
||||||
@ -42,7 +42,7 @@ static char *Explain_PlanToString(Plan * plan, ExplainState * es);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExplainQuery(Query * query, bool verbose, CommandDest dest)
|
ExplainQuery(Query *query, bool verbose, CommandDest dest)
|
||||||
{
|
{
|
||||||
char *s = NULL,
|
char *s = NULL,
|
||||||
*s2;
|
*s2;
|
||||||
@ -116,7 +116,7 @@ ExplainQuery(Query * query, bool verbose, CommandDest dest)
|
|||||||
* converts a Node into ascii string and append it to 'str'
|
* converts a Node into ascii string and append it to 'str'
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
explain_outNode(StringInfo str, Plan * plan, int indent, ExplainState * es)
|
explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
|
||||||
{
|
{
|
||||||
char *pname;
|
char *pname;
|
||||||
char buf[1000];
|
char buf[1000];
|
||||||
@ -225,7 +225,7 @@ explain_outNode(StringInfo str, Plan * plan, int indent, ExplainState * es)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
Explain_PlanToString(Plan * plan, ExplainState * es)
|
Explain_PlanToString(Plan *plan, ExplainState *es)
|
||||||
{
|
{
|
||||||
StringInfo str;
|
StringInfo str;
|
||||||
char *s;
|
char *s;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.8 1997/09/08 02:22:12 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.9 1997/09/08 21:42:42 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -36,7 +36,7 @@ extern CommandDest whereToSendOutput;
|
|||||||
#ifndef TIOGA
|
#ifndef TIOGA
|
||||||
|
|
||||||
void
|
void
|
||||||
beginRecipe(RecipeStmt * stmt)
|
beginRecipe(RecipeStmt *stmt)
|
||||||
{
|
{
|
||||||
elog(NOTICE, "You must compile with TIOGA defined in order to use recipes\n");
|
elog(NOTICE, "You must compile with TIOGA defined in order to use recipes\n");
|
||||||
}
|
}
|
||||||
@ -61,36 +61,36 @@ typedef struct _teeInfo
|
|||||||
TeePlanInfo *val;
|
TeePlanInfo *val;
|
||||||
} TeeInfo;
|
} 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,
|
||||||
@ -99,7 +99,7 @@ static QueryTreeList *
|
|||||||
tg_parseTeeNode(TgRecipe * r,
|
tg_parseTeeNode(TgRecipe * r,
|
||||||
TgNode * n,
|
TgNode * n,
|
||||||
int i,
|
int i,
|
||||||
QueryTreeList * qList,
|
QueryTreeList *qList,
|
||||||
TeeInfo * teeInfo);
|
TeeInfo * teeInfo);
|
||||||
|
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ tg_parseTeeNode(TgRecipe * r,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
beginRecipe(RecipeStmt * stmt)
|
beginRecipe(RecipeStmt *stmt)
|
||||||
{
|
{
|
||||||
TgRecipe *r;
|
TgRecipe *r;
|
||||||
int i;
|
int i;
|
||||||
@ -317,8 +317,8 @@ beginRecipe(RecipeStmt * stmt)
|
|||||||
static void
|
static void
|
||||||
tg_rewriteQuery(TgRecipe * r,
|
tg_rewriteQuery(TgRecipe * r,
|
||||||
TgNode * n,
|
TgNode * n,
|
||||||
QueryTreeList * q,
|
QueryTreeList *q,
|
||||||
QueryTreeList * inputQlist)
|
QueryTreeList *inputQlist)
|
||||||
{
|
{
|
||||||
Query *orig;
|
Query *orig;
|
||||||
Query *inputQ;
|
Query *inputQ;
|
||||||
@ -426,7 +426,7 @@ tg_rewriteQuery(TgRecipe * r,
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
static Node *
|
static Node *
|
||||||
tg_replaceNumberedParam(Node * expression,
|
tg_replaceNumberedParam(Node *expression,
|
||||||
int pnum, /* the number of the parameter */
|
int pnum, /* the number of the parameter */
|
||||||
int rt_ind, /* the range table index */
|
int rt_ind, /* the range table index */
|
||||||
char *teeRelName) /* the relname of the tee
|
char *teeRelName) /* the relname of the tee
|
||||||
@ -573,7 +573,7 @@ tg_replaceNumberedParam(Node * expression,
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
static Node *
|
static Node *
|
||||||
tg_rewriteParamsInExpr(Node * expression, QueryTreeList * inputQlist)
|
tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
|
||||||
{
|
{
|
||||||
List *tl;
|
List *tl;
|
||||||
TargetEntry *param_tle,
|
TargetEntry *param_tle,
|
||||||
@ -759,7 +759,7 @@ static QueryTreeList *
|
|||||||
tg_parseTeeNode(TgRecipe * r,
|
tg_parseTeeNode(TgRecipe * r,
|
||||||
TgNode * n, /* the tee node */
|
TgNode * n, /* the tee node */
|
||||||
int i, /* which input this node is to its parent */
|
int i, /* which input this node is to its parent */
|
||||||
QueryTreeList * qList,
|
QueryTreeList *qList,
|
||||||
TeeInfo * teeInfo)
|
TeeInfo * teeInfo)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -1104,7 +1104,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
OffsetVarAttno(Node * node, int varno, int offset)
|
OffsetVarAttno(Node *node, int varno, int offset)
|
||||||
{
|
{
|
||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
return;
|
return;
|
||||||
@ -1157,7 +1157,7 @@ OffsetVarAttno(Node * node, int varno, int offset)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
QueryTreeList *
|
QueryTreeList *
|
||||||
appendQlist(QueryTreeList * q1, QueryTreeList * q2)
|
appendQlist(QueryTreeList *q1, QueryTreeList *q2)
|
||||||
{
|
{
|
||||||
QueryTreeList *newq;
|
QueryTreeList *newq;
|
||||||
int i,
|
int i,
|
||||||
@ -1189,7 +1189,7 @@ appendQlist(QueryTreeList * q1, QueryTreeList * q2)
|
|||||||
* modify the query field of the teeInfo list of the particular tee node
|
* modify the query field of the teeInfo list of the particular tee node
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
appendTeeQuery(TeeInfo * teeInfo, QueryTreeList * q, char *teeNodeName)
|
appendTeeQuery(TeeInfo * teeInfo, QueryTreeList *q, char *teeNodeName)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1220,8 +1220,8 @@ appendTeeQuery(TeeInfo * teeInfo, QueryTreeList * q, char *teeNodeName)
|
|||||||
* qual or targetlist because the child plan has been replaced with a tee node
|
* qual or targetlist because the child plan has been replaced with a tee node
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
replaceSeqScan(Plan * plan, Plan * parent,
|
replaceSeqScan(Plan *plan, Plan *parent,
|
||||||
int rt_ind, Plan * tplan)
|
int rt_ind, Plan *tplan)
|
||||||
{
|
{
|
||||||
Scan *snode;
|
Scan *snode;
|
||||||
Tee *teePlan;
|
Tee *teePlan;
|
||||||
@ -1307,7 +1307,7 @@ replaceSeqScan(Plan * plan, Plan * parent,
|
|||||||
* a connection to the actual tee plan node
|
* a connection to the actual tee plan node
|
||||||
*/
|
*/
|
||||||
static Plan *
|
static Plan *
|
||||||
replaceTeeScans(Plan * plan, Query * parsetree, TeeInfo * teeInfo)
|
replaceTeeScans(Plan *plan, Query *parsetree, TeeInfo * teeInfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.13 1997/09/08 20:55:27 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.14 1997/09/08 21:42:44 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -330,7 +330,7 @@ RemoveType(char *typeName) /* type name to be removed */
|
|||||||
void
|
void
|
||||||
RemoveFunction(char *functionName, /* function name to be removed */
|
RemoveFunction(char *functionName, /* function name to be removed */
|
||||||
int nargs,
|
int nargs,
|
||||||
List * argNameList /* list of TypeNames */ )
|
List *argNameList /* list of TypeNames */ )
|
||||||
{
|
{
|
||||||
Relation relation;
|
Relation relation;
|
||||||
HeapScanDesc scan;
|
HeapScanDesc scan;
|
||||||
|
@ -36,14 +36,14 @@ typedef struct FormData_pg_sequence
|
|||||||
int4 cache_value;
|
int4 cache_value;
|
||||||
char is_cycled;
|
char is_cycled;
|
||||||
char is_called;
|
char is_called;
|
||||||
} FormData_pg_sequence;
|
} FormData_pg_sequence;
|
||||||
|
|
||||||
typedef FormData_pg_sequence *SequenceTupleForm;
|
typedef FormData_pg_sequence *SequenceTupleForm;
|
||||||
|
|
||||||
typedef struct sequence_magic
|
typedef struct sequence_magic
|
||||||
{
|
{
|
||||||
uint32 magic;
|
uint32 magic;
|
||||||
} sequence_magic;
|
} sequence_magic;
|
||||||
|
|
||||||
typedef struct SeqTableData
|
typedef struct SeqTableData
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ typedef struct SeqTableData
|
|||||||
int4 last;
|
int4 last;
|
||||||
int4 increment;
|
int4 increment;
|
||||||
struct SeqTableData *next;
|
struct SeqTableData *next;
|
||||||
} SeqTableData;
|
} SeqTableData;
|
||||||
|
|
||||||
typedef SeqTableData *SeqTable;
|
typedef SeqTableData *SeqTable;
|
||||||
|
|
||||||
@ -62,15 +62,15 @@ static SeqTable seqtab = NULL;
|
|||||||
|
|
||||||
static SeqTable init_sequence(char *caller, char *name);
|
static SeqTable init_sequence(char *caller, char *name);
|
||||||
static SequenceTupleForm read_info(char *caller, SeqTable elm, Buffer *buf);
|
static SequenceTupleForm read_info(char *caller, SeqTable elm, Buffer *buf);
|
||||||
static void init_params(CreateSeqStmt * seq, SequenceTupleForm new);
|
static void init_params(CreateSeqStmt *seq, SequenceTupleForm new);
|
||||||
static int get_param(DefElem * def);
|
static int get_param(DefElem *def);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DefineSequence --
|
* DefineSequence --
|
||||||
* Creates a new sequence relation
|
* Creates a new sequence relation
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
DefineSequence(CreateSeqStmt * seq)
|
DefineSequence(CreateSeqStmt *seq)
|
||||||
{
|
{
|
||||||
FormData_pg_sequence new;
|
FormData_pg_sequence new;
|
||||||
CreateStmt *stmt = makeNode(CreateStmt);
|
CreateStmt *stmt = makeNode(CreateStmt);
|
||||||
@ -459,7 +459,7 @@ CloseSequences(void)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_params(CreateSeqStmt * seq, SequenceTupleForm new)
|
init_params(CreateSeqStmt *seq, SequenceTupleForm new)
|
||||||
{
|
{
|
||||||
DefElem *last_value = NULL;
|
DefElem *last_value = NULL;
|
||||||
DefElem *increment_by = NULL;
|
DefElem *increment_by = NULL;
|
||||||
@ -544,7 +544,7 @@ init_params(CreateSeqStmt * seq, SequenceTupleForm new)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_param(DefElem * def)
|
get_param(DefElem *def)
|
||||||
{
|
{
|
||||||
if (def->arg == (Node *) NULL)
|
if (def->arg == (Node *) NULL)
|
||||||
elog(WARN, "DefineSequence: \"%s\" value unspecified", def->defname);
|
elog(WARN, "DefineSequence: \"%s\" value unspecified", def->defname);
|
||||||
|
@ -37,13 +37,13 @@ TriggerData *CurrentTriggerData = NULL;
|
|||||||
void RelationBuildTriggers(Relation relation);
|
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);
|
||||||
|
|
||||||
extern void fmgr_info(Oid procedureId, func_ptr * function, int *nargs);
|
extern void fmgr_info(Oid procedureId, func_ptr *function, int *nargs);
|
||||||
extern GlobalMemory CacheCxt;
|
extern GlobalMemory CacheCxt;
|
||||||
|
|
||||||
void
|
void
|
||||||
CreateTrigger(CreateTrigStmt * stmt)
|
CreateTrigger(CreateTrigStmt *stmt)
|
||||||
{
|
{
|
||||||
int16 tgtype;
|
int16 tgtype;
|
||||||
int16 tgattr[8] = {0};
|
int16 tgattr[8] = {0};
|
||||||
@ -211,7 +211,7 @@ CreateTrigger(CreateTrigStmt * stmt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DropTrigger(DropTrigStmt * stmt)
|
DropTrigger(DropTrigStmt *stmt)
|
||||||
{
|
{
|
||||||
Relation rel;
|
Relation rel;
|
||||||
Relation tgrel;
|
Relation tgrel;
|
||||||
@ -481,7 +481,7 @@ FreeTriggerDesc(Relation relation)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DescribeTrigger(TriggerDesc * trigdesc, Trigger * trigger)
|
DescribeTrigger(TriggerDesc *trigdesc, Trigger *trigger)
|
||||||
{
|
{
|
||||||
uint16 *n;
|
uint16 *n;
|
||||||
Trigger ***t,
|
Trigger ***t,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.45 1997/09/08 20:55:34 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.46 1997/09/08 21:42:48 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -74,37 +74,37 @@ static int MESSAGE_LEVEL; /* message level */
|
|||||||
/* non-export function prototypes */
|
/* non-export function prototypes */
|
||||||
static void vc_init(void);
|
static void vc_init(void);
|
||||||
static void vc_shutdown(void);
|
static void vc_shutdown(void);
|
||||||
static void vc_vacuum(NameData * VacRelP, bool analyze, List * va_cols);
|
static void vc_vacuum(NameData *VacRelP, bool analyze, List *va_cols);
|
||||||
static VRelList vc_getrels(NameData * VacRelP);
|
static VRelList vc_getrels(NameData *VacRelP);
|
||||||
static void vc_vacone(Oid relid, bool analyze, List * va_cols);
|
static void vc_vacone(Oid relid, bool analyze, List *va_cols);
|
||||||
static void vc_scanheap(VRelStats * vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl);
|
static void vc_scanheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl);
|
||||||
static void vc_rpfheap(VRelStats * vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl, int nindices, Relation * Irel);
|
static void vc_rpfheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl, int nindices, Relation *Irel);
|
||||||
static void vc_vacheap(VRelStats * vacrelstats, Relation onerel, VPageList vpl);
|
static void vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList vpl);
|
||||||
static void vc_vacpage(Page page, VPageDescr vpd, Relation archrel);
|
static void vc_vacpage(Page page, VPageDescr vpd, Relation archrel);
|
||||||
static void vc_vaconeind(VPageList vpl, Relation indrel, int nhtups);
|
static void vc_vaconeind(VPageList vpl, Relation indrel, int nhtups);
|
||||||
static void vc_scanoneind(Relation indrel, int nhtups);
|
static void vc_scanoneind(Relation indrel, int nhtups);
|
||||||
static void vc_attrstats(Relation onerel, VRelStats * vacrelstats, HeapTuple htup);
|
static void vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple htup);
|
||||||
static void vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum * bucket, int16 * bucket_len);
|
static void vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum *bucket, int16 *bucket_len);
|
||||||
static void vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats * vacrelstats);
|
static void vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelstats);
|
||||||
static void vc_delhilowstats(Oid relid, int attcnt, int *attnums);
|
static void vc_delhilowstats(Oid relid, int attcnt, int *attnums);
|
||||||
static void vc_setpagelock(Relation rel, BlockNumber blkno);
|
static void vc_setpagelock(Relation rel, BlockNumber blkno);
|
||||||
static VPageDescr vc_tidreapped(ItemPointer itemptr, VPageList vpl);
|
static VPageDescr vc_tidreapped(ItemPointer itemptr, VPageList vpl);
|
||||||
static void vc_reappage(VPageList vpl, VPageDescr vpc);
|
static void vc_reappage(VPageList vpl, VPageDescr vpc);
|
||||||
static void vc_vpinsert(VPageList vpl, VPageDescr vpnew);
|
static void vc_vpinsert(VPageList vpl, VPageDescr vpnew);
|
||||||
static void vc_free(VRelList vrl);
|
static void vc_free(VRelList vrl);
|
||||||
static void vc_getindices(Oid relid, int *nindices, Relation ** Irel);
|
static void vc_getindices(Oid relid, int *nindices, Relation **Irel);
|
||||||
static void vc_clsindices(int nindices, Relation * Irel);
|
static void vc_clsindices(int nindices, Relation *Irel);
|
||||||
static Relation vc_getarchrel(Relation heaprel);
|
static Relation vc_getarchrel(Relation heaprel);
|
||||||
static void vc_archive(Relation archrel, HeapTuple htup);
|
static void vc_archive(Relation archrel, HeapTuple htup);
|
||||||
static bool vc_isarchrel(char *rname);
|
static bool vc_isarchrel(char *rname);
|
||||||
static void vc_mkindesc(Relation onerel, int nindices, Relation * Irel, IndDesc ** Idesc);
|
static void vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc);
|
||||||
static char *vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, char *));
|
static char *vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, char *));
|
||||||
static int vc_cmp_blk(char *left, char *right);
|
static int vc_cmp_blk(char *left, char *right);
|
||||||
static int vc_cmp_offno(char *left, char *right);
|
static int vc_cmp_offno(char *left, char *right);
|
||||||
static bool vc_enough_space(VPageDescr vpd, Size len);
|
static bool vc_enough_space(VPageDescr vpd, Size len);
|
||||||
|
|
||||||
void
|
void
|
||||||
vacuum(char *vacrel, bool verbose, bool analyze, List * va_spec)
|
vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec)
|
||||||
{
|
{
|
||||||
char *pname;
|
char *pname;
|
||||||
MemoryContext old;
|
MemoryContext old;
|
||||||
@ -236,7 +236,7 @@ vc_abort()
|
|||||||
* locks at one time.
|
* locks at one time.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_vacuum(NameData * VacRelP, bool analyze, List * va_cols)
|
vc_vacuum(NameData *VacRelP, bool analyze, List *va_cols)
|
||||||
{
|
{
|
||||||
VRelList vrl,
|
VRelList vrl,
|
||||||
cur;
|
cur;
|
||||||
@ -255,7 +255,7 @@ vc_vacuum(NameData * VacRelP, bool analyze, List * va_cols)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VRelList
|
static VRelList
|
||||||
vc_getrels(NameData * VacRelP)
|
vc_getrels(NameData *VacRelP)
|
||||||
{
|
{
|
||||||
Relation pgclass;
|
Relation pgclass;
|
||||||
TupleDesc pgcdesc;
|
TupleDesc pgcdesc;
|
||||||
@ -402,7 +402,7 @@ vc_getrels(NameData * VacRelP)
|
|||||||
* us to lock the entire database during one pass of the vacuum cleaner.
|
* us to lock the entire database during one pass of the vacuum cleaner.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_vacone(Oid relid, bool analyze, List * va_cols)
|
vc_vacone(Oid relid, bool analyze, List *va_cols)
|
||||||
{
|
{
|
||||||
Relation pgclass;
|
Relation pgclass;
|
||||||
TupleDesc pgcdesc;
|
TupleDesc pgcdesc;
|
||||||
@ -639,7 +639,7 @@ vc_vacone(Oid relid, bool analyze, List * va_cols)
|
|||||||
* on the number of live tuples in a heap.
|
* on the number of live tuples in a heap.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_scanheap(VRelStats * vacrelstats, Relation onerel,
|
vc_scanheap(VRelStats *vacrelstats, Relation onerel,
|
||||||
VPageList Vvpl, VPageList Fvpl)
|
VPageList Vvpl, VPageList Fvpl)
|
||||||
{
|
{
|
||||||
int nblocks,
|
int nblocks,
|
||||||
@ -969,8 +969,8 @@ Tup %u: Vac %u, Crash %u, UnUsed %u, MinLen %u, MaxLen %u; Re-using: Free/Avail.
|
|||||||
* if some end-blocks are gone away.
|
* if some end-blocks are gone away.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_rpfheap(VRelStats * vacrelstats, Relation onerel,
|
vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
||||||
VPageList Vvpl, VPageList Fvpl, int nindices, Relation * Irel)
|
VPageList Vvpl, VPageList Fvpl, int nindices, Relation *Irel)
|
||||||
{
|
{
|
||||||
TransactionId myXID;
|
TransactionId myXID;
|
||||||
CommandId myCID;
|
CommandId myCID;
|
||||||
@ -1424,7 +1424,7 @@ Elapsed %u/%u sec.",
|
|||||||
* if there are "empty" end-blocks.
|
* if there are "empty" end-blocks.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_vacheap(VRelStats * vacrelstats, Relation onerel, VPageList Vvpl)
|
vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl)
|
||||||
{
|
{
|
||||||
Buffer buf;
|
Buffer buf;
|
||||||
Page page;
|
Page page;
|
||||||
@ -1700,7 +1700,7 @@ vc_tidreapped(ItemPointer itemptr, VPageList vpl)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_attrstats(Relation onerel, VRelStats * vacrelstats, HeapTuple htup)
|
vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple htup)
|
||||||
{
|
{
|
||||||
int i,
|
int i,
|
||||||
attr_cnt = vacrelstats->va_natts;
|
attr_cnt = vacrelstats->va_natts;
|
||||||
@ -1800,7 +1800,7 @@ vc_attrstats(Relation onerel, VRelStats * vacrelstats, HeapTuple htup)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum * bucket, int16 * bucket_len)
|
vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum *bucket, int16 *bucket_len)
|
||||||
{
|
{
|
||||||
if (attr->attbyval && attr->attlen != -1)
|
if (attr->attbyval && attr->attlen != -1)
|
||||||
*bucket = value;
|
*bucket = value;
|
||||||
@ -1831,7 +1831,7 @@ vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum * bucket, int16 * bucke
|
|||||||
* historical queries very expensive.
|
* historical queries very expensive.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats * vacrelstats)
|
vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelstats)
|
||||||
{
|
{
|
||||||
Relation rd,
|
Relation rd,
|
||||||
ad,
|
ad,
|
||||||
@ -2259,7 +2259,7 @@ vc_cmp_offno(char *left, char *right)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vc_getindices(Oid relid, int *nindices, Relation ** Irel)
|
vc_getindices(Oid relid, int *nindices, Relation **Irel)
|
||||||
{
|
{
|
||||||
Relation pgindex;
|
Relation pgindex;
|
||||||
Relation irel;
|
Relation irel;
|
||||||
@ -2336,7 +2336,7 @@ vc_getindices(Oid relid, int *nindices, Relation ** Irel)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vc_clsindices(int nindices, Relation * Irel)
|
vc_clsindices(int nindices, Relation *Irel)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Irel == (Relation *) NULL)
|
if (Irel == (Relation *) NULL)
|
||||||
@ -2352,7 +2352,7 @@ vc_clsindices(int nindices, Relation * Irel)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vc_mkindesc(Relation onerel, int nindices, Relation * Irel, IndDesc ** Idesc)
|
vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc)
|
||||||
{
|
{
|
||||||
IndDesc *idcur;
|
IndDesc *idcur;
|
||||||
HeapTuple pgIndexTup;
|
HeapTuple pgIndexTup;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.10 1997/09/08 02:22:20 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.11 1997/09/08 21:42:50 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -42,7 +42,7 @@
|
|||||||
*---------------------------------------------------------------------
|
*---------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
DefineVirtualRelation(char *relname, List * tlist)
|
DefineVirtualRelation(char *relname, List *tlist)
|
||||||
{
|
{
|
||||||
CreateStmt createStmt;
|
CreateStmt createStmt;
|
||||||
List *attrList,
|
List *attrList,
|
||||||
@ -143,7 +143,7 @@ MakeRetrieveViewRuleName(char *viewName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static RuleStmt *
|
static RuleStmt *
|
||||||
FormViewRetrieveRule(char *viewName, Query * viewParse)
|
FormViewRetrieveRule(char *viewName, Query *viewParse)
|
||||||
{
|
{
|
||||||
RuleStmt *rule;
|
RuleStmt *rule;
|
||||||
char *rname;
|
char *rname;
|
||||||
@ -170,7 +170,7 @@ FormViewRetrieveRule(char *viewName, Query * viewParse)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DefineViewRules(char *viewName, Query * viewParse)
|
DefineViewRules(char *viewName, Query *viewParse)
|
||||||
{
|
{
|
||||||
RuleStmt *retrieve_rule = NULL;
|
RuleStmt *retrieve_rule = NULL;
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ DefineViewRules(char *viewName, Query * viewParse)
|
|||||||
*---------------------------------------------------------------
|
*---------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
UpdateRangeTableOfViewParse(char *viewName, Query * viewParse)
|
UpdateRangeTableOfViewParse(char *viewName, Query *viewParse)
|
||||||
{
|
{
|
||||||
List *old_rt;
|
List *old_rt;
|
||||||
List *new_rt;
|
List *new_rt;
|
||||||
@ -275,7 +275,7 @@ UpdateRangeTableOfViewParse(char *viewName, Query * viewParse)
|
|||||||
*-------------------------------------------------------------------
|
*-------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
DefineView(char *viewName, Query * viewParse)
|
DefineView(char *viewName, Query *viewParse)
|
||||||
{
|
{
|
||||||
List *viewTlist;
|
List *viewTlist;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.7 1997/09/08 02:22:23 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.8 1997/09/08 21:42:52 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -71,8 +71,8 @@ ExecOpenScanR(Oid relOid,
|
|||||||
bool isindex,
|
bool isindex,
|
||||||
ScanDirection dir,
|
ScanDirection dir,
|
||||||
TimeQual timeRange,
|
TimeQual timeRange,
|
||||||
Relation * returnRelation, /* return */
|
Relation *returnRelation, /* return */
|
||||||
Pointer * returnScanDesc) /* return */
|
Pointer *returnScanDesc) /* return */
|
||||||
{
|
{
|
||||||
Relation relation;
|
Relation relation;
|
||||||
Pointer scanDesc;
|
Pointer scanDesc;
|
||||||
@ -195,7 +195,7 @@ ExecBeginScan(Relation relation,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecCloseR(Plan * node)
|
ExecCloseR(Plan *node)
|
||||||
{
|
{
|
||||||
CommonScanState *state;
|
CommonScanState *state;
|
||||||
Relation relation;
|
Relation relation;
|
||||||
@ -288,7 +288,7 @@ ExecCloseR(Plan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecReScan(Plan * node, ExprContext * exprCtxt, Plan * parent)
|
ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent)
|
||||||
{
|
{
|
||||||
switch (nodeTag(node))
|
switch (nodeTag(node))
|
||||||
{
|
{
|
||||||
@ -328,7 +328,7 @@ ExecReScan(Plan * node, ExprContext * exprCtxt, Plan * parent)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
HeapScanDesc
|
HeapScanDesc
|
||||||
ExecReScanR(Relation relDesc, /* LLL relDesc unused */
|
ExecReScanR(Relation relDesc, /* LLL relDesc unused */
|
||||||
HeapScanDesc scanDesc,
|
HeapScanDesc scanDesc,
|
||||||
ScanDirection direction,
|
ScanDirection direction,
|
||||||
int nkeys, /* LLL nkeys unused */
|
int nkeys, /* LLL nkeys unused */
|
||||||
@ -351,7 +351,7 @@ ExecReScanR(Relation relDesc, /* LLL relDesc unused */
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecMarkPos(Plan * node)
|
ExecMarkPos(Plan *node)
|
||||||
{
|
{
|
||||||
switch (nodeTag(node))
|
switch (nodeTag(node))
|
||||||
{
|
{
|
||||||
@ -381,7 +381,7 @@ ExecMarkPos(Plan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecRestrPos(Plan * node)
|
ExecRestrPos(Plan *node)
|
||||||
{
|
{
|
||||||
switch (nodeTag(node))
|
switch (nodeTag(node))
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/execFlatten.c,v 1.4 1997/09/08 02:22:25 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/execFlatten.c,v 1.5 1997/09/08 21:42:55 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -34,16 +34,16 @@
|
|||||||
|
|
||||||
#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
|
||||||
|
|
||||||
Datum
|
Datum
|
||||||
ExecEvalIter(Iter * iterNode,
|
ExecEvalIter(Iter *iterNode,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
bool * resultIsNull,
|
bool *resultIsNull,
|
||||||
bool * iterIsDone)
|
bool *iterIsDone)
|
||||||
{
|
{
|
||||||
Node *expression;
|
Node *expression;
|
||||||
|
|
||||||
@ -59,10 +59,10 @@ ExecEvalIter(Iter * iterNode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExecEvalFjoin(TargetEntry * tlist,
|
ExecEvalFjoin(TargetEntry *tlist,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
bool * isNullVect,
|
bool *isNullVect,
|
||||||
bool * fj_isDone)
|
bool *fj_isDone)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef SETS_FIXED
|
#ifdef SETS_FIXED
|
||||||
@ -182,8 +182,8 @@ ExecEvalFjoin(TargetEntry * tlist,
|
|||||||
|
|
||||||
#ifdef SETS_FIXED
|
#ifdef SETS_FIXED
|
||||||
static bool
|
static bool
|
||||||
FjoinBumpOuterNodes(TargetEntry * tlist,
|
FjoinBumpOuterNodes(TargetEntry *tlist,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
DatumPtr results,
|
DatumPtr results,
|
||||||
char *nulls)
|
char *nulls)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.7 1997/09/08 02:22:27 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.8 1997/09/08 21:42:56 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -61,7 +61,7 @@
|
|||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
JunkFilter *
|
JunkFilter *
|
||||||
ExecInitJunkFilter(List * targetList)
|
ExecInitJunkFilter(List *targetList)
|
||||||
{
|
{
|
||||||
JunkFilter *junkfilter;
|
JunkFilter *junkfilter;
|
||||||
List *cleanTargetList;
|
List *cleanTargetList;
|
||||||
@ -264,11 +264,11 @@ ExecInitJunkFilter(List * targetList)
|
|||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecGetJunkAttribute(JunkFilter * junkfilter,
|
ExecGetJunkAttribute(JunkFilter *junkfilter,
|
||||||
TupleTableSlot * slot,
|
TupleTableSlot *slot,
|
||||||
char *attrName,
|
char *attrName,
|
||||||
Datum * value,
|
Datum *value,
|
||||||
bool * isNull)
|
bool *isNull)
|
||||||
{
|
{
|
||||||
List *targetList;
|
List *targetList;
|
||||||
List *t;
|
List *t;
|
||||||
@ -328,7 +328,7 @@ ExecGetJunkAttribute(JunkFilter * junkfilter,
|
|||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
HeapTuple
|
HeapTuple
|
||||||
ExecRemoveJunk(JunkFilter * junkfilter, TupleTableSlot * slot)
|
ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
|
||||||
{
|
{
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
HeapTuple cleanTuple;
|
HeapTuple cleanTuple;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.24 1997/09/08 02:22:28 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.25 1997/09/08 21:42:57 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -57,28 +57,28 @@
|
|||||||
|
|
||||||
/* decls for local routines only used within this module */
|
/* decls for local routines only used within this module */
|
||||||
static void
|
static void
|
||||||
ExecCheckPerms(CmdType operation, int resultRelation, List * rangeTable,
|
ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
|
||||||
Query * parseTree);
|
Query *parseTree);
|
||||||
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 */
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ ExecutorLimit(int limit)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleDesc
|
TupleDesc
|
||||||
ExecutorStart(QueryDesc * queryDesc, EState * estate)
|
ExecutorStart(QueryDesc *queryDesc, EState *estate)
|
||||||
{
|
{
|
||||||
TupleDesc result;
|
TupleDesc result;
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ ExecutorStart(QueryDesc * queryDesc, EState * estate)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecutorRun(QueryDesc * queryDesc, EState * estate, int feature, int count)
|
ExecutorRun(QueryDesc *queryDesc, EState *estate, int feature, int count)
|
||||||
{
|
{
|
||||||
CmdType operation;
|
CmdType operation;
|
||||||
Query *parseTree;
|
Query *parseTree;
|
||||||
@ -279,7 +279,7 @@ ExecutorRun(QueryDesc * queryDesc, EState * estate, int feature, int count)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecutorEnd(QueryDesc * queryDesc, EState * estate)
|
ExecutorEnd(QueryDesc *queryDesc, EState *estate)
|
||||||
{
|
{
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
Assert(queryDesc != NULL);
|
Assert(queryDesc != NULL);
|
||||||
@ -300,8 +300,8 @@ ExecutorEnd(QueryDesc * queryDesc, EState * estate)
|
|||||||
static void
|
static void
|
||||||
ExecCheckPerms(CmdType operation,
|
ExecCheckPerms(CmdType operation,
|
||||||
int resultRelation,
|
int resultRelation,
|
||||||
List * rangeTable,
|
List *rangeTable,
|
||||||
Query * parseTree)
|
Query *parseTree)
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
Oid relid;
|
Oid relid;
|
||||||
@ -390,7 +390,7 @@ ExecCheckPerms(CmdType operation,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static TupleDesc
|
static TupleDesc
|
||||||
InitPlan(CmdType operation, Query * parseTree, Plan * plan, EState * estate)
|
InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
|
||||||
{
|
{
|
||||||
List *rangeTable;
|
List *rangeTable;
|
||||||
int resultRelation;
|
int resultRelation;
|
||||||
@ -625,7 +625,7 @@ InitPlan(CmdType operation, Query * parseTree, Plan * plan, EState * estate)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
EndPlan(Plan * plan, EState * estate)
|
EndPlan(Plan *plan, EState *estate)
|
||||||
{
|
{
|
||||||
RelationInfo *resultRelationInfo;
|
RelationInfo *resultRelationInfo;
|
||||||
Relation intoRelationDesc;
|
Relation intoRelationDesc;
|
||||||
@ -699,9 +699,9 @@ EndPlan(Plan * plan, EState * estate)
|
|||||||
user can see it*/
|
user can see it*/
|
||||||
|
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
ExecutePlan(EState * estate,
|
ExecutePlan(EState *estate,
|
||||||
Plan * plan,
|
Plan *plan,
|
||||||
Query * parseTree,
|
Query *parseTree,
|
||||||
CmdType operation,
|
CmdType operation,
|
||||||
int numberTuples,
|
int numberTuples,
|
||||||
ScanDirection direction,
|
ScanDirection direction,
|
||||||
@ -898,9 +898,9 @@ ExecutePlan(EState * estate,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ExecRetrieve(TupleTableSlot * slot,
|
ExecRetrieve(TupleTableSlot *slot,
|
||||||
void (*printfunc) (),
|
void (*printfunc) (),
|
||||||
EState * estate)
|
EState *estate)
|
||||||
{
|
{
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
TupleDesc attrtype;
|
TupleDesc attrtype;
|
||||||
@ -941,9 +941,9 @@ ExecRetrieve(TupleTableSlot * slot,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ExecAppend(TupleTableSlot * slot,
|
ExecAppend(TupleTableSlot *slot,
|
||||||
ItemPointer tupleid,
|
ItemPointer tupleid,
|
||||||
EState * estate)
|
EState *estate)
|
||||||
{
|
{
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
RelationInfo *resultRelationInfo;
|
RelationInfo *resultRelationInfo;
|
||||||
@ -1046,9 +1046,9 @@ ExecAppend(TupleTableSlot * slot,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ExecDelete(TupleTableSlot * slot,
|
ExecDelete(TupleTableSlot *slot,
|
||||||
ItemPointer tupleid,
|
ItemPointer tupleid,
|
||||||
EState * estate)
|
EState *estate)
|
||||||
{
|
{
|
||||||
RelationInfo *resultRelationInfo;
|
RelationInfo *resultRelationInfo;
|
||||||
Relation resultRelationDesc;
|
Relation resultRelationDesc;
|
||||||
@ -1114,10 +1114,10 @@ ExecDelete(TupleTableSlot * slot,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ExecReplace(TupleTableSlot * slot,
|
ExecReplace(TupleTableSlot *slot,
|
||||||
ItemPointer tupleid,
|
ItemPointer tupleid,
|
||||||
EState * estate,
|
EState *estate,
|
||||||
Query * parseTree)
|
Query *parseTree)
|
||||||
{
|
{
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
RelationInfo *resultRelationInfo;
|
RelationInfo *resultRelationInfo;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.4 1997/09/08 02:22:30 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.5 1997/09/08 21:42:59 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -103,7 +103,7 @@
|
|||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitNode(Plan * node, EState * estate, Plan * parent)
|
ExecInitNode(Plan *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ ExecInitNode(Plan * node, EState * estate, Plan * parent)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecProcNode(Plan * node, Plan * parent)
|
ExecProcNode(Plan *node, Plan *parent)
|
||||||
{
|
{
|
||||||
TupleTableSlot *result;
|
TupleTableSlot *result;
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ ExecProcNode(Plan * node, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsNode(Plan * node)
|
ExecCountSlotsNode(Plan *node)
|
||||||
{
|
{
|
||||||
if (node == (Plan *) NULL)
|
if (node == (Plan *) NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@ -387,7 +387,7 @@ ExecCountSlotsNode(Plan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndNode(Plan * node, Plan * parent)
|
ExecEndNode(Plan *node, Plan *parent)
|
||||||
{
|
{
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* do nothing when we get to the end
|
* do nothing when we get to the end
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.15 1997/09/08 20:55:37 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.16 1997/09/08 21:43:00 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -69,27 +69,27 @@ bool execConstByVal;
|
|||||||
int execConstLen;
|
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);
|
||||||
|
|
||||||
/* --------------------------------
|
/* --------------------------------
|
||||||
* ExecEvalArrayRef
|
* ExecEvalArrayRef
|
||||||
@ -102,9 +102,9 @@ static bool ExecQualClause(Node * clause, ExprContext * econtext);
|
|||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
ExecEvalArrayRef(ArrayRef *arrayRef,
|
ExecEvalArrayRef(ArrayRef *arrayRef,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
bool * isNull,
|
bool *isNull,
|
||||||
bool * isDone)
|
bool *isDone)
|
||||||
{
|
{
|
||||||
bool dummy;
|
bool dummy;
|
||||||
int i = 0,
|
int i = 0,
|
||||||
@ -200,7 +200,7 @@ ExecEvalArrayRef(ArrayRef *arrayRef,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
ExecEvalAggreg(Aggreg *agg, ExprContext * econtext, bool * isNull)
|
ExecEvalAggreg(Aggreg *agg, ExprContext *econtext, bool *isNull)
|
||||||
{
|
{
|
||||||
|
|
||||||
*isNull = econtext->ecxt_nulls[agg->aggno];
|
*isNull = econtext->ecxt_nulls[agg->aggno];
|
||||||
@ -231,7 +231,7 @@ ExecEvalAggreg(Aggreg *agg, ExprContext * econtext, bool * isNull)
|
|||||||
*
|
*
|
||||||
* ---------------------------------------------------------------- */
|
* ---------------------------------------------------------------- */
|
||||||
static Datum
|
static Datum
|
||||||
ExecEvalVar(Var * variable, ExprContext * econtext, bool * isNull)
|
ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
|
||||||
{
|
{
|
||||||
Datum result;
|
Datum result;
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
@ -377,7 +377,7 @@ ExecEvalVar(Var * variable, ExprContext * econtext, bool * isNull)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
Datum
|
Datum
|
||||||
ExecEvalParam(Param * expression, ExprContext * econtext, bool * isNull)
|
ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
|
||||||
{
|
{
|
||||||
|
|
||||||
char *thisParameterName;
|
char *thisParameterName;
|
||||||
@ -509,9 +509,9 @@ ExecEvalParam(Param * expression, ExprContext * econtext, bool * isNull)
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
static char *
|
static char *
|
||||||
GetAttributeByNum(TupleTableSlot * slot,
|
GetAttributeByNum(TupleTableSlot *slot,
|
||||||
AttrNumber attrno,
|
AttrNumber attrno,
|
||||||
bool * isNull)
|
bool *isNull)
|
||||||
{
|
{
|
||||||
Datum retval;
|
Datum retval;
|
||||||
|
|
||||||
@ -546,9 +546,9 @@ GetAttributeByNum(TupleTableSlot * slot,
|
|||||||
/* XXX char16 name for catalogs */
|
/* XXX char16 name for catalogs */
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
char *
|
char *
|
||||||
att_by_num(TupleTableSlot * slot,
|
att_by_num(TupleTableSlot *slot,
|
||||||
AttrNumber attrno,
|
AttrNumber attrno,
|
||||||
bool * isNull)
|
bool *isNull)
|
||||||
{
|
{
|
||||||
return (GetAttributeByNum(slot, attrno, isNull));
|
return (GetAttributeByNum(slot, attrno, isNull));
|
||||||
}
|
}
|
||||||
@ -556,7 +556,7 @@ att_by_num(TupleTableSlot * slot,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *
|
char *
|
||||||
GetAttributeByName(TupleTableSlot * slot, char *attname, bool * isNull)
|
GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
|
||||||
{
|
{
|
||||||
AttrNumber attrno;
|
AttrNumber attrno;
|
||||||
TupleDesc tupdesc;
|
TupleDesc tupdesc;
|
||||||
@ -609,7 +609,7 @@ GetAttributeByName(TupleTableSlot * slot, char *attname, bool * isNull)
|
|||||||
/* XXX char16 name for catalogs */
|
/* XXX char16 name for catalogs */
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
char *
|
char *
|
||||||
att_by_name(TupleTableSlot * slot, char *attname, bool * isNull)
|
att_by_name(TupleTableSlot *slot, char *attname, bool *isNull)
|
||||||
{
|
{
|
||||||
return (GetAttributeByName(slot, attname, isNull));
|
return (GetAttributeByName(slot, attname, isNull));
|
||||||
}
|
}
|
||||||
@ -618,10 +618,10 @@ att_by_name(TupleTableSlot * slot, char *attname, bool * isNull)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
ExecEvalFuncArgs(FunctionCachePtr fcache,
|
ExecEvalFuncArgs(FunctionCachePtr fcache,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
List * argList,
|
List *argList,
|
||||||
Datum argV[],
|
Datum argV[],
|
||||||
bool * argIsDone)
|
bool *argIsDone)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
bool argIsNull,
|
bool argIsNull,
|
||||||
@ -664,11 +664,11 @@ ExecEvalFuncArgs(FunctionCachePtr fcache,
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
ExecMakeFunctionResult(Node * node,
|
ExecMakeFunctionResult(Node *node,
|
||||||
List * arguments,
|
List *arguments,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
bool * isNull,
|
bool *isNull,
|
||||||
bool * isDone)
|
bool *isDone)
|
||||||
{
|
{
|
||||||
Datum argv[MAXFMGRARGS];
|
Datum argv[MAXFMGRARGS];
|
||||||
FunctionCachePtr fcache;
|
FunctionCachePtr fcache;
|
||||||
@ -864,7 +864,7 @@ ExecMakeFunctionResult(Node * node,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
ExecEvalOper(Expr * opClause, ExprContext * econtext, bool * isNull)
|
ExecEvalOper(Expr *opClause, ExprContext *econtext, bool *isNull)
|
||||||
{
|
{
|
||||||
Oper *op;
|
Oper *op;
|
||||||
List *argList;
|
List *argList;
|
||||||
@ -909,10 +909,10 @@ ExecEvalOper(Expr * opClause, ExprContext * econtext, bool * isNull)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static Datum
|
static Datum
|
||||||
ExecEvalFunc(Expr * funcClause,
|
ExecEvalFunc(Expr *funcClause,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
bool * isNull,
|
bool *isNull,
|
||||||
bool * isDone)
|
bool *isDone)
|
||||||
{
|
{
|
||||||
Func *func;
|
Func *func;
|
||||||
List *argList;
|
List *argList;
|
||||||
@ -964,7 +964,7 @@ ExecEvalFunc(Expr * funcClause,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
ExecEvalNot(Expr * notclause, ExprContext * econtext, bool * isNull)
|
ExecEvalNot(Expr *notclause, ExprContext *econtext, bool *isNull)
|
||||||
{
|
{
|
||||||
Datum expr_value;
|
Datum expr_value;
|
||||||
Node *clause;
|
Node *clause;
|
||||||
@ -1003,7 +1003,7 @@ ExecEvalNot(Expr * notclause, ExprContext * econtext, bool * isNull)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
ExecEvalOr(Expr * orExpr, ExprContext * econtext, bool * isNull)
|
ExecEvalOr(Expr *orExpr, ExprContext *econtext, bool *isNull)
|
||||||
{
|
{
|
||||||
List *clauses;
|
List *clauses;
|
||||||
List *clause;
|
List *clause;
|
||||||
@ -1067,7 +1067,7 @@ ExecEvalOr(Expr * orExpr, ExprContext * econtext, bool * isNull)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
ExecEvalAnd(Expr * andExpr, ExprContext * econtext, bool * isNull)
|
ExecEvalAnd(Expr *andExpr, ExprContext *econtext, bool *isNull)
|
||||||
{
|
{
|
||||||
List *clauses;
|
List *clauses;
|
||||||
List *clause;
|
List *clause;
|
||||||
@ -1144,10 +1144,10 @@ ExecEvalAnd(Expr * andExpr, ExprContext * econtext, bool * isNull)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
Datum
|
Datum
|
||||||
ExecEvalExpr(Node * expression,
|
ExecEvalExpr(Node *expression,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
bool * isNull,
|
bool *isNull,
|
||||||
bool * isDone)
|
bool *isDone)
|
||||||
{
|
{
|
||||||
Datum retDatum = 0;
|
Datum retDatum = 0;
|
||||||
|
|
||||||
@ -1257,7 +1257,7 @@ ExecEvalExpr(Node * expression,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
ExecQualClause(Node * clause, ExprContext * econtext)
|
ExecQualClause(Node *clause, ExprContext *econtext)
|
||||||
{
|
{
|
||||||
Datum expr_value;
|
Datum expr_value;
|
||||||
bool isNull;
|
bool isNull;
|
||||||
@ -1302,7 +1302,7 @@ ExecQualClause(Node * clause, ExprContext * econtext)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecQual(List * qual, ExprContext * econtext)
|
ExecQual(List *qual, ExprContext *econtext)
|
||||||
{
|
{
|
||||||
List *clause;
|
List *clause;
|
||||||
bool result;
|
bool result;
|
||||||
@ -1354,7 +1354,7 @@ ExecQual(List * qual, ExprContext * econtext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecTargetListLength(List * targetlist)
|
ExecTargetListLength(List *targetlist)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
List *tl;
|
List *tl;
|
||||||
@ -1381,12 +1381,12 @@ ExecTargetListLength(List * targetlist)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static HeapTuple
|
static HeapTuple
|
||||||
ExecTargetList(List * targetlist,
|
ExecTargetList(List *targetlist,
|
||||||
int nodomains,
|
int nodomains,
|
||||||
TupleDesc targettype,
|
TupleDesc targettype,
|
||||||
Datum * values,
|
Datum *values,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
bool * isDone)
|
bool *isDone)
|
||||||
{
|
{
|
||||||
char nulls_array[64];
|
char nulls_array[64];
|
||||||
bool fjNullArray[64];
|
bool fjNullArray[64];
|
||||||
@ -1579,7 +1579,7 @@ ExecTargetList(List * targetlist,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecProject(ProjectionInfo * projInfo, bool * isDone)
|
ExecProject(ProjectionInfo *projInfo, bool *isDone)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
List *targetlist;
|
List *targetlist;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.5 1997/09/08 02:22:34 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.6 1997/09/08 21:43:02 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -43,8 +43,8 @@
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecScan(Scan * node,
|
ExecScan(Scan *node,
|
||||||
TupleTableSlot * (*accessMtd) ()) /* function returning a
|
TupleTableSlot *(*accessMtd) ()) /* function returning a
|
||||||
* tuple */
|
* tuple */
|
||||||
{
|
{
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.8 1997/09/08 02:22:35 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.9 1997/09/08 21:43:03 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -131,7 +131,7 @@
|
|||||||
#include "parser/catalog_utils.h"
|
#include "parser/catalog_utils.h"
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
|
|
||||||
static TupleTableSlot *NodeGetResultTupleSlot(Plan * node);
|
static TupleTableSlot *NodeGetResultTupleSlot(Plan *node);
|
||||||
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
@ -150,8 +150,8 @@ static TupleTableSlot *NodeGetResultTupleSlot(Plan * node);
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTable /* return: address of table */
|
TupleTable /* return: address of table */
|
||||||
ExecCreateTupleTable(int initialSize) /* initial number of slots
|
ExecCreateTupleTable(int initialSize) /* initial number of slots in
|
||||||
* in table */
|
* table */
|
||||||
{
|
{
|
||||||
TupleTable newtable; /* newly allocated table */
|
TupleTable newtable; /* newly allocated table */
|
||||||
TupleTableSlot *array; /* newly allocated slot array */
|
TupleTableSlot *array; /* newly allocated slot array */
|
||||||
@ -349,7 +349,7 @@ ExecAllocTableSlot(TupleTable table)
|
|||||||
*/
|
*/
|
||||||
TupleTableSlot * /* return: slot passed */
|
TupleTableSlot * /* return: slot passed */
|
||||||
ExecStoreTuple(HeapTuple tuple, /* tuple to store */
|
ExecStoreTuple(HeapTuple tuple, /* tuple to store */
|
||||||
TupleTableSlot * slot, /* slot in which to store tuple */
|
TupleTableSlot *slot, /* slot in which to store tuple */
|
||||||
Buffer buffer, /* buffer associated with tuple */
|
Buffer buffer, /* buffer associated with tuple */
|
||||||
bool shouldFree) /* true if we call pfree() when we gc. */
|
bool shouldFree) /* true if we call pfree() when we gc. */
|
||||||
{
|
{
|
||||||
@ -381,7 +381,7 @@ ExecStoreTuple(HeapTuple tuple, /* tuple to store */
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot * /* return: slot passed */
|
TupleTableSlot * /* return: slot passed */
|
||||||
ExecClearTuple(TupleTableSlot * slot) /* slot in which to store tuple */
|
ExecClearTuple(TupleTableSlot *slot) /* slot in which to store tuple */
|
||||||
{
|
{
|
||||||
HeapTuple oldtuple; /* prior contents of slot */
|
HeapTuple oldtuple; /* prior contents of slot */
|
||||||
|
|
||||||
@ -441,7 +441,7 @@ ExecClearTuple(TupleTableSlot * slot) /* slot in which to store tuple */
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
bool /* return: slot policy */
|
bool /* return: slot policy */
|
||||||
ExecSlotPolicy(TupleTableSlot * slot) /* slot to inspect */
|
ExecSlotPolicy(TupleTableSlot *slot) /* slot to inspect */
|
||||||
{
|
{
|
||||||
return slot->ttc_shouldFree;
|
return slot->ttc_shouldFree;
|
||||||
}
|
}
|
||||||
@ -458,7 +458,7 @@ ExecSlotPolicy(TupleTableSlot * slot) /* slot to inspect */
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
bool /* return: old slot policy */
|
bool /* return: old slot policy */
|
||||||
ExecSetSlotPolicy(TupleTableSlot * slot, /* slot to change */
|
ExecSetSlotPolicy(TupleTableSlot *slot, /* slot to change */
|
||||||
bool shouldFree) /* true if we call pfree() when we
|
bool shouldFree) /* true if we call pfree() when we
|
||||||
* gc. */
|
* gc. */
|
||||||
{
|
{
|
||||||
@ -487,7 +487,7 @@ ExecSetSlotPolicy(TupleTableSlot * slot, /* slot to change */
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
TupleDesc /* return: old slot tuple descriptor */
|
TupleDesc /* return: old slot tuple descriptor */
|
||||||
ExecSetSlotDescriptor(TupleTableSlot * slot, /* slot to change */
|
ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */
|
||||||
TupleDesc tupdesc) /* tuple descriptor */
|
TupleDesc tupdesc) /* tuple descriptor */
|
||||||
{
|
{
|
||||||
TupleDesc old_tupdesc = slot->ttc_tupleDescriptor;
|
TupleDesc old_tupdesc = slot->ttc_tupleDescriptor;
|
||||||
@ -503,7 +503,7 @@ ExecSetSlotDescriptor(TupleTableSlot * slot, /* slot to change */
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecSetSlotDescriptorIsNew(TupleTableSlot * slot, /* slot to change */
|
ExecSetSlotDescriptorIsNew(TupleTableSlot *slot, /* slot to change */
|
||||||
bool isNew) /* "isNew" setting */
|
bool isNew) /* "isNew" setting */
|
||||||
{
|
{
|
||||||
slot->ttc_descIsNew = isNew;
|
slot->ttc_descIsNew = isNew;
|
||||||
@ -518,7 +518,7 @@ ExecSetSlotDescriptorIsNew(TupleTableSlot * slot, /* slot to change */
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
TupleDesc /* return: old slot tuple descriptor */
|
TupleDesc /* return: old slot tuple descriptor */
|
||||||
ExecSetNewSlotDescriptor(TupleTableSlot * slot, /* slot to change */
|
ExecSetNewSlotDescriptor(TupleTableSlot *slot, /* slot to change */
|
||||||
TupleDesc tupdesc) /* tuple descriptor */
|
TupleDesc tupdesc) /* tuple descriptor */
|
||||||
{
|
{
|
||||||
TupleDesc old_tupdesc = slot->ttc_tupleDescriptor;
|
TupleDesc old_tupdesc = slot->ttc_tupleDescriptor;
|
||||||
@ -554,7 +554,7 @@ ExecSetNewSlotDescriptor(TupleTableSlot * slot, /* slot to change */
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
Buffer /* return: old slot buffer */
|
Buffer /* return: old slot buffer */
|
||||||
ExecSetSlotBuffer(TupleTableSlot * slot, /* slot to change */
|
ExecSetSlotBuffer(TupleTableSlot *slot, /* slot to change */
|
||||||
Buffer b) /* tuple descriptor */
|
Buffer b) /* tuple descriptor */
|
||||||
{
|
{
|
||||||
Buffer oldb = slot->ttc_buffer;
|
Buffer oldb = slot->ttc_buffer;
|
||||||
@ -575,7 +575,7 @@ ExecSetSlotBuffer(TupleTableSlot * slot, /* slot to change */
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecIncrSlotBufferRefcnt(TupleTableSlot * slot) /* slot to bump refcnt */
|
ExecIncrSlotBufferRefcnt(TupleTableSlot *slot) /* slot to bump refcnt */
|
||||||
{
|
{
|
||||||
/* Buffer b = SlotBuffer((TupleTableSlot*) slot); */
|
/* Buffer b = SlotBuffer((TupleTableSlot*) slot); */
|
||||||
Buffer b = slot->ttc_buffer;
|
Buffer b = slot->ttc_buffer;
|
||||||
@ -597,7 +597,7 @@ ExecIncrSlotBufferRefcnt(TupleTableSlot * slot) /* slot to bump refcnt */
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
bool /* return: true if tuple in slot is NULL */
|
bool /* return: true if tuple in slot is NULL */
|
||||||
TupIsNull(TupleTableSlot * slot) /* slot to check */
|
TupIsNull(TupleTableSlot *slot) /* slot to check */
|
||||||
{
|
{
|
||||||
HeapTuple tuple; /* contents of slot (returned) */
|
HeapTuple tuple; /* contents of slot (returned) */
|
||||||
|
|
||||||
@ -629,7 +629,7 @@ TupIsNull(TupleTableSlot * slot) /* slot to check */
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
bool /* return: descriptor "is new" */
|
bool /* return: descriptor "is new" */
|
||||||
ExecSlotDescriptorIsNew(TupleTableSlot * slot) /* slot to inspect */
|
ExecSlotDescriptorIsNew(TupleTableSlot *slot) /* slot to inspect */
|
||||||
{
|
{
|
||||||
/* bool isNew = SlotTupleDescriptorIsNew((TupleTableSlot*) slot);
|
/* bool isNew = SlotTupleDescriptorIsNew((TupleTableSlot*) slot);
|
||||||
return isNew; */
|
return isNew; */
|
||||||
@ -667,7 +667,7 @@ ExecSlotDescriptorIsNew(TupleTableSlot * slot) /* slot to inspect */
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecInitResultTupleSlot(EState * estate, CommonState * commonstate)
|
ExecInitResultTupleSlot(EState *estate, CommonState *commonstate)
|
||||||
{
|
{
|
||||||
INIT_SLOT_DEFS;
|
INIT_SLOT_DEFS;
|
||||||
INIT_SLOT_ALLOC;
|
INIT_SLOT_ALLOC;
|
||||||
@ -679,7 +679,7 @@ ExecInitResultTupleSlot(EState * estate, CommonState * commonstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecInitScanTupleSlot(EState * estate, CommonScanState * commonscanstate)
|
ExecInitScanTupleSlot(EState *estate, CommonScanState *commonscanstate)
|
||||||
{
|
{
|
||||||
INIT_SLOT_DEFS;
|
INIT_SLOT_DEFS;
|
||||||
INIT_SLOT_ALLOC;
|
INIT_SLOT_ALLOC;
|
||||||
@ -691,7 +691,7 @@ ExecInitScanTupleSlot(EState * estate, CommonScanState * commonscanstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecInitMarkedTupleSlot(EState * estate, MergeJoinState * mergestate)
|
ExecInitMarkedTupleSlot(EState *estate, MergeJoinState *mergestate)
|
||||||
{
|
{
|
||||||
INIT_SLOT_DEFS;
|
INIT_SLOT_DEFS;
|
||||||
INIT_SLOT_ALLOC;
|
INIT_SLOT_ALLOC;
|
||||||
@ -703,7 +703,7 @@ ExecInitMarkedTupleSlot(EState * estate, MergeJoinState * mergestate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecInitOuterTupleSlot(EState * estate, HashJoinState * hashstate)
|
ExecInitOuterTupleSlot(EState *estate, HashJoinState *hashstate)
|
||||||
{
|
{
|
||||||
INIT_SLOT_DEFS;
|
INIT_SLOT_DEFS;
|
||||||
INIT_SLOT_ALLOC;
|
INIT_SLOT_ALLOC;
|
||||||
@ -716,7 +716,7 @@ ExecInitOuterTupleSlot(EState * estate, HashJoinState * hashstate)
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
void
|
void
|
||||||
ExecInitHashTupleSlot(EState * estate, HashJoinState * hashstate)
|
ExecInitHashTupleSlot(EState *estate, HashJoinState *hashstate)
|
||||||
{
|
{
|
||||||
INIT_SLOT_DEFS;
|
INIT_SLOT_DEFS;
|
||||||
INIT_SLOT_ALLOC;
|
INIT_SLOT_ALLOC;
|
||||||
@ -726,7 +726,7 @@ ExecInitHashTupleSlot(EState * estate, HashJoinState * hashstate)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
NodeGetResultTupleSlot(Plan * node)
|
NodeGetResultTupleSlot(Plan *node)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
|
|
||||||
@ -894,7 +894,7 @@ NodeGetResultTupleSlot(Plan * node)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
TupleDesc
|
TupleDesc
|
||||||
ExecGetTupType(Plan * node)
|
ExecGetTupType(Plan *node)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
TupleDesc tupType;
|
TupleDesc tupType;
|
||||||
@ -946,7 +946,7 @@ ExecCopyTupType(TupleDesc td, int natts)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleDesc
|
TupleDesc
|
||||||
ExecTypeFromTL(List * targetList)
|
ExecTypeFromTL(List *targetList)
|
||||||
{
|
{
|
||||||
List *tlcdr;
|
List *tlcdr;
|
||||||
TupleDesc typeInfo;
|
TupleDesc typeInfo;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.17 1997/09/08 20:55:39 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.18 1997/09/08 21:43:05 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -106,7 +106,7 @@ ResetTupleCount(void)
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
void
|
void
|
||||||
DisplayTupleCount(FILE * statfp)
|
DisplayTupleCount(FILE *statfp)
|
||||||
{
|
{
|
||||||
if (NTupleProcessed > 0)
|
if (NTupleProcessed > 0)
|
||||||
fprintf(statfp, "!\t%d tuple%s processed, ", NTupleProcessed,
|
fprintf(statfp, "!\t%d tuple%s processed, ", NTupleProcessed,
|
||||||
@ -157,7 +157,7 @@ DisplayTupleCount(FILE * statfp)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecAssignNodeBaseInfo(EState * estate, CommonState * cstate, Plan * parent)
|
ExecAssignNodeBaseInfo(EState *estate, CommonState *cstate, Plan *parent)
|
||||||
{
|
{
|
||||||
int baseId;
|
int baseId;
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ ExecAssignNodeBaseInfo(EState * estate, CommonState * cstate, Plan * parent)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecAssignExprContext(EState * estate, CommonState * commonstate)
|
ExecAssignExprContext(EState *estate, CommonState *commonstate)
|
||||||
{
|
{
|
||||||
ExprContext *econtext;
|
ExprContext *econtext;
|
||||||
ParamListInfo paraminfo;
|
ParamListInfo paraminfo;
|
||||||
@ -207,7 +207,7 @@ ExecAssignExprContext(EState * estate, CommonState * commonstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecAssignResultType(CommonState * commonstate,
|
ExecAssignResultType(CommonState *commonstate,
|
||||||
TupleDesc tupDesc)
|
TupleDesc tupDesc)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
@ -221,7 +221,7 @@ ExecAssignResultType(CommonState * commonstate,
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecAssignResultTypeFromOuterPlan(Plan * node, CommonState * commonstate)
|
ExecAssignResultTypeFromOuterPlan(Plan *node, CommonState *commonstate)
|
||||||
{
|
{
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
TupleDesc tupDesc;
|
TupleDesc tupDesc;
|
||||||
@ -237,7 +237,7 @@ ExecAssignResultTypeFromOuterPlan(Plan * node, CommonState * commonstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecAssignResultTypeFromTL(Plan * node, CommonState * commonstate)
|
ExecAssignResultTypeFromTL(Plan *node, CommonState *commonstate)
|
||||||
{
|
{
|
||||||
List *targetList;
|
List *targetList;
|
||||||
int i;
|
int i;
|
||||||
@ -293,7 +293,7 @@ ExecAssignResultTypeFromTL(Plan * node, CommonState * commonstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
TupleDesc
|
TupleDesc
|
||||||
ExecGetResultType(CommonState * commonstate)
|
ExecGetResultType(CommonState *commonstate)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot = commonstate->cs_ResultTupleSlot;
|
TupleTableSlot *slot = commonstate->cs_ResultTupleSlot;
|
||||||
|
|
||||||
@ -306,7 +306,7 @@ ExecGetResultType(CommonState * commonstate)
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
void
|
void
|
||||||
ExecFreeResultType(CommonState * commonstate)
|
ExecFreeResultType(CommonState *commonstate)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
TupleDesc tupType;
|
TupleDesc tupType;
|
||||||
@ -326,7 +326,7 @@ ExecFreeResultType(CommonState * commonstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecAssignProjectionInfo(Plan * node, CommonState * commonstate)
|
ExecAssignProjectionInfo(Plan *node, CommonState *commonstate)
|
||||||
{
|
{
|
||||||
ProjectionInfo *projInfo;
|
ProjectionInfo *projInfo;
|
||||||
List *targetList;
|
List *targetList;
|
||||||
@ -352,7 +352,7 @@ ExecAssignProjectionInfo(Plan * node, CommonState * commonstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecFreeProjectionInfo(CommonState * commonstate)
|
ExecFreeProjectionInfo(CommonState *commonstate)
|
||||||
{
|
{
|
||||||
ProjectionInfo *projInfo;
|
ProjectionInfo *projInfo;
|
||||||
|
|
||||||
@ -391,7 +391,7 @@ ExecFreeProjectionInfo(CommonState * commonstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
TupleDesc
|
TupleDesc
|
||||||
ExecGetScanType(CommonScanState * csstate)
|
ExecGetScanType(CommonScanState *csstate)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot = csstate->css_ScanTupleSlot;
|
TupleTableSlot *slot = csstate->css_ScanTupleSlot;
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ ExecGetScanType(CommonScanState * csstate)
|
|||||||
*/
|
*/
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
void
|
void
|
||||||
ExecFreeScanType(CommonScanState * csstate)
|
ExecFreeScanType(CommonScanState *csstate)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
TupleDesc tupType;
|
TupleDesc tupType;
|
||||||
@ -423,7 +423,7 @@ ExecFreeScanType(CommonScanState * csstate)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecAssignScanType(CommonScanState * csstate,
|
ExecAssignScanType(CommonScanState *csstate,
|
||||||
TupleDesc tupDesc)
|
TupleDesc tupDesc)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
@ -437,7 +437,7 @@ ExecAssignScanType(CommonScanState * csstate,
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecAssignScanTypeFromOuterPlan(Plan * node, CommonScanState * csstate)
|
ExecAssignScanTypeFromOuterPlan(Plan *node, CommonScanState *csstate)
|
||||||
{
|
{
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
TupleDesc tupDesc;
|
TupleDesc tupDesc;
|
||||||
@ -569,7 +569,7 @@ ExecFreeTypeInfo(TupleDesc typeInfo)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleDesc
|
TupleDesc
|
||||||
QueryDescGetTypeInfo(QueryDesc * queryDesc)
|
QueryDescGetTypeInfo(QueryDesc *queryDesc)
|
||||||
{
|
{
|
||||||
Plan *plan;
|
Plan *plan;
|
||||||
TupleDesc tupleType;
|
TupleDesc tupleType;
|
||||||
@ -706,7 +706,7 @@ ExecGetIndexKeyInfo(IndexTupleForm indexTuple,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecOpenIndices(Oid resultRelationOid,
|
ExecOpenIndices(Oid resultRelationOid,
|
||||||
RelationInfo * resultRelationInfo)
|
RelationInfo *resultRelationInfo)
|
||||||
{
|
{
|
||||||
Relation indexRd;
|
Relation indexRd;
|
||||||
HeapScanDesc indexSd;
|
HeapScanDesc indexSd;
|
||||||
@ -952,7 +952,7 @@ ExecOpenIndices(Oid resultRelationOid,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecCloseIndices(RelationInfo * resultRelationInfo)
|
ExecCloseIndices(RelationInfo *resultRelationInfo)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int numIndices;
|
int numIndices;
|
||||||
@ -984,7 +984,7 @@ IndexTuple
|
|||||||
ExecFormIndexTuple(HeapTuple heapTuple,
|
ExecFormIndexTuple(HeapTuple heapTuple,
|
||||||
Relation heapRelation,
|
Relation heapRelation,
|
||||||
Relation indexRelation,
|
Relation indexRelation,
|
||||||
IndexInfo * indexInfo)
|
IndexInfo *indexInfo)
|
||||||
{
|
{
|
||||||
IndexTuple indexTuple;
|
IndexTuple indexTuple;
|
||||||
TupleDesc heapDescriptor;
|
TupleDesc heapDescriptor;
|
||||||
@ -1070,9 +1070,9 @@ ExecFormIndexTuple(HeapTuple heapTuple,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecInsertIndexTuples(TupleTableSlot * slot,
|
ExecInsertIndexTuples(TupleTableSlot *slot,
|
||||||
ItemPointer tupleid,
|
ItemPointer tupleid,
|
||||||
EState * estate,
|
EState *estate,
|
||||||
bool is_update)
|
bool is_update)
|
||||||
{
|
{
|
||||||
HeapTuple heapTuple;
|
HeapTuple heapTuple;
|
||||||
@ -1186,8 +1186,8 @@ ExecInsertIndexTuples(TupleTableSlot * slot,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
setVarAttrLenForCreateTable(TupleDesc tupType, List * targetList,
|
setVarAttrLenForCreateTable(TupleDesc tupType, List *targetList,
|
||||||
List * rangeTable)
|
List *rangeTable)
|
||||||
{
|
{
|
||||||
List *tl;
|
List *tl;
|
||||||
TargetEntry *tle;
|
TargetEntry *tle;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.9 1997/09/08 02:22:37 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.10 1997/09/08 21:43:08 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -44,7 +44,7 @@
|
|||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
F_EXEC_START, F_EXEC_RUN, F_EXEC_DONE
|
F_EXEC_START, F_EXEC_RUN, F_EXEC_DONE
|
||||||
} ExecStatus;
|
} ExecStatus;
|
||||||
|
|
||||||
typedef struct local_es
|
typedef struct local_es
|
||||||
{
|
{
|
||||||
@ -52,30 +52,30 @@ typedef struct local_es
|
|||||||
EState *estate;
|
EState *estate;
|
||||||
struct local_es *next;
|
struct local_es *next;
|
||||||
ExecStatus status;
|
ExecStatus status;
|
||||||
} execution_state;
|
} execution_state;
|
||||||
|
|
||||||
#define LAST_POSTQUEL_COMMAND(es) ((es)->next == (execution_state *)NULL)
|
#define LAST_POSTQUEL_COMMAND(es) ((es)->next == (execution_state *)NULL)
|
||||||
|
|
||||||
/* 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);
|
||||||
|
|
||||||
|
|
||||||
Datum
|
Datum
|
||||||
ProjectAttribute(TupleDesc TD,
|
ProjectAttribute(TupleDesc TD,
|
||||||
TargetEntry * tlist,
|
TargetEntry *tlist,
|
||||||
HeapTuple tup,
|
HeapTuple tup,
|
||||||
bool * isnullP)
|
bool *isnullP)
|
||||||
{
|
{
|
||||||
Datum val,
|
Datum val,
|
||||||
valueP;
|
valueP;
|
||||||
@ -172,7 +172,7 @@ init_execution_state(FunctionCachePtr fcache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static TupleDesc
|
static TupleDesc
|
||||||
postquel_start(execution_state * es)
|
postquel_start(execution_state *es)
|
||||||
{
|
{
|
||||||
#ifdef FUNC_UTIL_PATCH
|
#ifdef FUNC_UTIL_PATCH
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ postquel_start(execution_state * es)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
postquel_getnext(execution_state * es)
|
postquel_getnext(execution_state *es)
|
||||||
{
|
{
|
||||||
int feature;
|
int feature;
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ postquel_getnext(execution_state * es)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
postquel_end(execution_state * es)
|
postquel_end(execution_state *es)
|
||||||
{
|
{
|
||||||
#ifdef FUNC_UTIL_PATCH
|
#ifdef FUNC_UTIL_PATCH
|
||||||
|
|
||||||
@ -231,10 +231,10 @@ postquel_end(execution_state * es)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
postquel_sub_params(execution_state * es,
|
postquel_sub_params(execution_state *es,
|
||||||
int nargs,
|
int nargs,
|
||||||
char *args[],
|
char *args[],
|
||||||
bool * nullV)
|
bool *nullV)
|
||||||
{
|
{
|
||||||
ParamListInfo paramLI;
|
ParamListInfo paramLI;
|
||||||
EState *estate;
|
EState *estate;
|
||||||
@ -256,7 +256,7 @@ postquel_sub_params(execution_state * es,
|
|||||||
|
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
copy_function_result(FunctionCachePtr fcache,
|
copy_function_result(FunctionCachePtr fcache,
|
||||||
TupleTableSlot * resultSlot)
|
TupleTableSlot *resultSlot)
|
||||||
{
|
{
|
||||||
TupleTableSlot *funcSlot;
|
TupleTableSlot *funcSlot;
|
||||||
TupleDesc resultTd;
|
TupleDesc resultTd;
|
||||||
@ -299,11 +299,11 @@ copy_function_result(FunctionCachePtr fcache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Datum
|
static Datum
|
||||||
postquel_execute(execution_state * es,
|
postquel_execute(execution_state *es,
|
||||||
FunctionCachePtr fcache,
|
FunctionCachePtr fcache,
|
||||||
List * fTlist,
|
List *fTlist,
|
||||||
char **args,
|
char **args,
|
||||||
bool * isNull)
|
bool *isNull)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
Datum value;
|
Datum value;
|
||||||
@ -398,7 +398,7 @@ postquel_execute(execution_state * es,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Datum
|
Datum
|
||||||
postquel_function(Func * funcNode, char **args, bool * isNull, bool * isDone)
|
postquel_function(Func *funcNode, char **args, bool *isNull, bool *isDone)
|
||||||
{
|
{
|
||||||
execution_state *es;
|
execution_state *es;
|
||||||
Datum result = 0;
|
Datum result = 0;
|
||||||
|
@ -47,7 +47,7 @@ typedef struct AggFuncInfo
|
|||||||
int finalfn_nargs;
|
int finalfn_nargs;
|
||||||
} AggFuncInfo;
|
} AggFuncInfo;
|
||||||
|
|
||||||
static Datum aggGetAttr(TupleTableSlot * tuple, Aggreg *agg, bool * isNull);
|
static Datum aggGetAttr(TupleTableSlot *tuple, Aggreg *agg, bool *isNull);
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------
|
/* ---------------------------------------
|
||||||
@ -376,7 +376,7 @@ ExecAgg(Agg *node)
|
|||||||
value2[i] =
|
value2[i] =
|
||||||
(Datum) fmgr_c(aggfns->xfn2, aggfns->xfn2_oid,
|
(Datum) fmgr_c(aggfns->xfn2, aggfns->xfn2_oid,
|
||||||
aggfns->xfn2_nargs,
|
aggfns->xfn2_nargs,
|
||||||
(FmgrValues *) & xfn2_val, &isNull2);
|
(FmgrValues *) &xfn2_val, &isNull2);
|
||||||
Assert(!isNull2);
|
Assert(!isNull2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -488,7 +488,7 @@ ExecAgg(Agg *node)
|
|||||||
* -----------------
|
* -----------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitAgg(Agg *node, EState * estate, Plan * parent)
|
ExecInitAgg(Agg *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
AggState *aggstate;
|
AggState *aggstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -591,9 +591,9 @@ ExecEndAgg(Agg *node)
|
|||||||
* over from the tuple
|
* over from the tuple
|
||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
aggGetAttr(TupleTableSlot * slot,
|
aggGetAttr(TupleTableSlot *slot,
|
||||||
Aggreg *agg,
|
Aggreg *agg,
|
||||||
bool * isNull)
|
bool *isNull)
|
||||||
{
|
{
|
||||||
Datum result;
|
Datum result;
|
||||||
AttrNumber attnum;
|
AttrNumber attnum;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.8 1997/09/08 20:55:41 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.9 1997/09/08 21:43:10 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -182,7 +182,7 @@ exec_append_initialize_next(Append *node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitAppend(Append *node, EState * estate, Plan * parent)
|
ExecInitAppend(Append *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
AppendState *unionstate;
|
AppendState *unionstate;
|
||||||
int nplans;
|
int nplans;
|
||||||
|
@ -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.8 1997/09/08 20:55:43 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.9 1997/09/08 21:43:10 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -28,10 +28,10 @@
|
|||||||
#include "executor/executor.h"
|
#include "executor/executor.h"
|
||||||
#include "executor/nodeGroup.h"
|
#include "executor/nodeGroup.h"
|
||||||
|
|
||||||
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(TupleTableSlot * oldslot, TupleTableSlot * newslot,
|
sameGroup(TupleTableSlot *oldslot, TupleTableSlot *newslot,
|
||||||
int numCols, AttrNumber *grpColIdx, TupleDesc tupdesc);
|
int numCols, AttrNumber *grpColIdx, TupleDesc tupdesc);
|
||||||
|
|
||||||
/* ---------------------------------------
|
/* ---------------------------------------
|
||||||
@ -51,7 +51,7 @@ sameGroup(TupleTableSlot * oldslot, TupleTableSlot * newslot,
|
|||||||
* ------------------------------------------
|
* ------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecGroup(Group * node)
|
ExecGroup(Group *node)
|
||||||
{
|
{
|
||||||
if (node->tuplePerGroup)
|
if (node->tuplePerGroup)
|
||||||
return ExecGroupEveryTuple(node);
|
return ExecGroupEveryTuple(node);
|
||||||
@ -64,7 +64,7 @@ ExecGroup(Group * node)
|
|||||||
* return every tuple with a NULL between each group
|
* return every tuple with a NULL between each group
|
||||||
*/
|
*/
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
ExecGroupEveryTuple(Group * node)
|
ExecGroupEveryTuple(Group *node)
|
||||||
{
|
{
|
||||||
GroupState *grpstate;
|
GroupState *grpstate;
|
||||||
EState *estate;
|
EState *estate;
|
||||||
@ -165,7 +165,7 @@ ExecGroupEveryTuple(Group * node)
|
|||||||
* tuples.
|
* tuples.
|
||||||
*/
|
*/
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
ExecGroupOneTuple(Group * node)
|
ExecGroupOneTuple(Group *node)
|
||||||
{
|
{
|
||||||
GroupState *grpstate;
|
GroupState *grpstate;
|
||||||
EState *estate;
|
EState *estate;
|
||||||
@ -289,7 +289,7 @@ ExecGroupOneTuple(Group * node)
|
|||||||
* -----------------
|
* -----------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitGroup(Group * node, EState * estate, Plan * parent)
|
ExecInitGroup(Group *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
GroupState *grpstate;
|
GroupState *grpstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -345,7 +345,7 @@ ExecInitGroup(Group * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsGroup(Group * node)
|
ExecCountSlotsGroup(Group *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan(node)) + GROUP_NSLOTS;
|
return ExecCountSlotsNode(outerPlan(node)) + GROUP_NSLOTS;
|
||||||
}
|
}
|
||||||
@ -356,7 +356,7 @@ ExecCountSlotsGroup(Group * node)
|
|||||||
* -----------------------
|
* -----------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndGroup(Group * node)
|
ExecEndGroup(Group *node)
|
||||||
{
|
{
|
||||||
GroupState *grpstate;
|
GroupState *grpstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -380,8 +380,8 @@ ExecEndGroup(Group * node)
|
|||||||
* code swiped from nodeUnique.c
|
* code swiped from nodeUnique.c
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
sameGroup(TupleTableSlot * oldslot,
|
sameGroup(TupleTableSlot *oldslot,
|
||||||
TupleTableSlot * newslot,
|
TupleTableSlot *newslot,
|
||||||
int numCols,
|
int numCols,
|
||||||
AttrNumber *grpColIdx,
|
AttrNumber *grpColIdx,
|
||||||
TupleDesc tupdesc)
|
TupleDesc tupdesc)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.12 1997/09/08 02:22:42 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.13 1997/09/08 21:43:11 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -47,7 +47,7 @@ static int HashTBSize;
|
|||||||
|
|
||||||
static void mk_hj_temp(char *tempname);
|
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,
|
||||||
@ -62,7 +62,7 @@ ExecHashOverflowInsert(HashJoinTable hashtable,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecHash(Hash * node)
|
ExecHash(Hash *node)
|
||||||
{
|
{
|
||||||
EState *estate;
|
EState *estate;
|
||||||
HashState *hashstate;
|
HashState *hashstate;
|
||||||
@ -165,7 +165,7 @@ ExecHash(Hash * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitHash(Hash * node, EState * estate, Plan * parent)
|
ExecInitHash(Hash *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
HashState *hashstate;
|
HashState *hashstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -224,7 +224,7 @@ ExecInitHash(Hash * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsHash(Hash * node)
|
ExecCountSlotsHash(Hash *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan(node)) +
|
return ExecCountSlotsNode(outerPlan(node)) +
|
||||||
ExecCountSlotsNode(innerPlan(node)) +
|
ExecCountSlotsNode(innerPlan(node)) +
|
||||||
@ -238,7 +238,7 @@ ExecCountSlotsHash(Hash * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndHash(Hash * node)
|
ExecEndHash(Hash *node)
|
||||||
{
|
{
|
||||||
HashState *hashstate;
|
HashState *hashstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -288,7 +288,7 @@ hashTableAlloc(int size, HashJoinTable hashtable)
|
|||||||
#define FUDGE_FAC 1.5
|
#define FUDGE_FAC 1.5
|
||||||
|
|
||||||
HashJoinTable
|
HashJoinTable
|
||||||
ExecHashTableCreate(Hash * node)
|
ExecHashTableCreate(Hash *node)
|
||||||
{
|
{
|
||||||
Plan *outerNode;
|
Plan *outerNode;
|
||||||
int nbatch;
|
int nbatch;
|
||||||
@ -456,9 +456,9 @@ ExecHashTableCreate(Hash * node)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecHashTableInsert(HashJoinTable hashtable,
|
ExecHashTableInsert(HashJoinTable hashtable,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
Var * hashkey,
|
Var *hashkey,
|
||||||
File * batches)
|
File *batches)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
HeapTuple heapTuple;
|
HeapTuple heapTuple;
|
||||||
@ -548,8 +548,8 @@ ExecHashTableDestroy(HashJoinTable hashtable)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
ExecHashGetBucket(HashJoinTable hashtable,
|
ExecHashGetBucket(HashJoinTable hashtable,
|
||||||
ExprContext * econtext,
|
ExprContext *econtext,
|
||||||
Var * hashkey)
|
Var *hashkey)
|
||||||
{
|
{
|
||||||
int bucketno;
|
int bucketno;
|
||||||
Datum keyval;
|
Datum keyval;
|
||||||
@ -681,11 +681,11 @@ ExecHashOverflowInsert(HashJoinTable hashtable,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
HeapTuple
|
HeapTuple
|
||||||
ExecScanHashBucket(HashJoinState * hjstate,
|
ExecScanHashBucket(HashJoinState *hjstate,
|
||||||
HashBucket bucket,
|
HashBucket bucket,
|
||||||
HeapTuple curtuple,
|
HeapTuple curtuple,
|
||||||
List * hjclauses,
|
List *hjclauses,
|
||||||
ExprContext * econtext)
|
ExprContext *econtext)
|
||||||
{
|
{
|
||||||
HeapTuple heapTuple;
|
HeapTuple heapTuple;
|
||||||
bool qualResult;
|
bool qualResult;
|
||||||
@ -826,7 +826,7 @@ hashFunc(char *key, int len)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ExecHashPartition(Hash * node)
|
ExecHashPartition(Hash *node)
|
||||||
{
|
{
|
||||||
Plan *outerNode;
|
Plan *outerNode;
|
||||||
int b;
|
int b;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.7 1997/09/08 02:22:43 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.8 1997/09/08 21:43:12 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -33,17 +33,17 @@
|
|||||||
#include "utils/palloc.h"
|
#include "utils/palloc.h"
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ static int ExecHashJoinNewBatch(HashJoinState * hjstate);
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot * /* return: a tuple or NULL */
|
TupleTableSlot * /* return: a tuple or NULL */
|
||||||
ExecHashJoin(HashJoin * node)
|
ExecHashJoin(HashJoin *node)
|
||||||
{
|
{
|
||||||
HashJoinState *hjstate;
|
HashJoinState *hjstate;
|
||||||
EState *estate;
|
EState *estate;
|
||||||
@ -392,7 +392,7 @@ ExecHashJoin(HashJoin * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool /* return: initialization status */
|
bool /* return: initialization status */
|
||||||
ExecInitHashJoin(HashJoin * node, EState * estate, Plan * parent)
|
ExecInitHashJoin(HashJoin *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
HashJoinState *hjstate;
|
HashJoinState *hjstate;
|
||||||
Plan *outerNode;
|
Plan *outerNode;
|
||||||
@ -497,7 +497,7 @@ ExecInitHashJoin(HashJoin * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsHashJoin(HashJoin * node)
|
ExecCountSlotsHashJoin(HashJoin *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan(node)) +
|
return ExecCountSlotsNode(outerPlan(node)) +
|
||||||
ExecCountSlotsNode(innerPlan(node)) +
|
ExecCountSlotsNode(innerPlan(node)) +
|
||||||
@ -511,7 +511,7 @@ ExecCountSlotsHashJoin(HashJoin * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndHashJoin(HashJoin * node)
|
ExecEndHashJoin(HashJoin *node)
|
||||||
{
|
{
|
||||||
HashJoinState *hjstate;
|
HashJoinState *hjstate;
|
||||||
|
|
||||||
@ -569,7 +569,7 @@ ExecEndHashJoin(HashJoin * node)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
ExecHashJoinOuterGetTuple(Plan * node, Plan * parent, HashJoinState * hjstate)
|
ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
HashJoinTable hashtable;
|
HashJoinTable hashtable;
|
||||||
@ -619,10 +619,10 @@ ExecHashJoinOuterGetTuple(Plan * node, Plan * parent, HashJoinState * hjstate)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
ExecHashJoinGetSavedTuple(HashJoinState * hjstate,
|
ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
|
||||||
char *buffer,
|
char *buffer,
|
||||||
File file,
|
File file,
|
||||||
TupleTableSlot * tupleSlot,
|
TupleTableSlot *tupleSlot,
|
||||||
int *block, /* return parameter */
|
int *block, /* return parameter */
|
||||||
char **position) /* return parameter */
|
char **position) /* return parameter */
|
||||||
{
|
{
|
||||||
@ -664,7 +664,7 @@ ExecHashJoinGetSavedTuple(HashJoinState * hjstate,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ExecHashJoinNewBatch(HashJoinState * hjstate)
|
ExecHashJoinNewBatch(HashJoinState *hjstate)
|
||||||
{
|
{
|
||||||
File *innerBatches;
|
File *innerBatches;
|
||||||
File *outerBatches;
|
File *outerBatches;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.9 1997/09/08 02:22:44 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.10 1997/09/08 21:43:13 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -55,7 +55,7 @@
|
|||||||
#define LEFT_OP 1
|
#define LEFT_OP 1
|
||||||
#define RIGHT_OP 2
|
#define RIGHT_OP 2
|
||||||
|
|
||||||
static TupleTableSlot *IndexNext(IndexScan * node);
|
static TupleTableSlot *IndexNext(IndexScan *node);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
* IndexNext
|
* IndexNext
|
||||||
@ -80,7 +80,7 @@ static TupleTableSlot *IndexNext(IndexScan * node);
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
IndexNext(IndexScan * node)
|
IndexNext(IndexScan *node)
|
||||||
{
|
{
|
||||||
EState *estate;
|
EState *estate;
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
@ -192,7 +192,7 @@ IndexNext(IndexScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecIndexScan(IndexScan * node)
|
ExecIndexScan(IndexScan *node)
|
||||||
{
|
{
|
||||||
TupleTableSlot *returnTuple;
|
TupleTableSlot *returnTuple;
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ ExecIndexScan(IndexScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecIndexReScan(IndexScan * node, ExprContext * exprCtxt, Plan * parent)
|
ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
|
||||||
{
|
{
|
||||||
EState *estate;
|
EState *estate;
|
||||||
IndexScanState *indexstate;
|
IndexScanState *indexstate;
|
||||||
@ -331,7 +331,7 @@ ExecIndexReScan(IndexScan * node, ExprContext * exprCtxt, Plan * parent)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndIndexScan(IndexScan * node)
|
ExecEndIndexScan(IndexScan *node)
|
||||||
{
|
{
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
IndexScanState *indexstate;
|
IndexScanState *indexstate;
|
||||||
@ -395,7 +395,7 @@ ExecEndIndexScan(IndexScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecIndexMarkPos(IndexScan * node)
|
ExecIndexMarkPos(IndexScan *node)
|
||||||
{
|
{
|
||||||
IndexScanState *indexstate;
|
IndexScanState *indexstate;
|
||||||
IndexScanDescPtr indexScanDescs;
|
IndexScanDescPtr indexScanDescs;
|
||||||
@ -426,7 +426,7 @@ ExecIndexMarkPos(IndexScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecIndexRestrPos(IndexScan * node)
|
ExecIndexRestrPos(IndexScan *node)
|
||||||
{
|
{
|
||||||
IndexScanState *indexstate;
|
IndexScanState *indexstate;
|
||||||
IndexScanDescPtr indexScanDescs;
|
IndexScanDescPtr indexScanDescs;
|
||||||
@ -461,7 +461,7 @@ ExecIndexRestrPos(IndexScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent)
|
ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
IndexScanState *indexstate;
|
IndexScanState *indexstate;
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
@ -677,7 +677,7 @@ ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent)
|
|||||||
*/
|
*/
|
||||||
leftop = (Node *) get_leftop(clause);
|
leftop = (Node *) get_leftop(clause);
|
||||||
|
|
||||||
if (IsA(leftop, Var) && var_is_rel((Var *) leftop))
|
if (IsA(leftop, Var) &&var_is_rel((Var *) leftop))
|
||||||
{
|
{
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* if the leftop is a "rel-var", then it means
|
* if the leftop is a "rel-var", then it means
|
||||||
@ -750,7 +750,7 @@ ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent)
|
|||||||
*/
|
*/
|
||||||
rightop = (Node *) get_rightop(clause);
|
rightop = (Node *) get_rightop(clause);
|
||||||
|
|
||||||
if (IsA(rightop, Var) && var_is_rel((Var *) rightop))
|
if (IsA(rightop, Var) &&var_is_rel((Var *) rightop))
|
||||||
{
|
{
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* here we make sure only one op identifies the
|
* here we make sure only one op identifies the
|
||||||
@ -920,7 +920,7 @@ ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent)
|
|||||||
direction, /* scan direction */
|
direction, /* scan direction */
|
||||||
timeQual, /* time qual */
|
timeQual, /* time qual */
|
||||||
¤tRelation, /* return: rel desc */
|
¤tRelation, /* return: rel desc */
|
||||||
(Pointer *) & currentScanDesc); /* return: scan desc */
|
(Pointer *) ¤tScanDesc); /* return: scan desc */
|
||||||
|
|
||||||
scanstate->css_currentRelation = currentRelation;
|
scanstate->css_currentRelation = currentRelation;
|
||||||
scanstate->css_currentScanDesc = currentScanDesc;
|
scanstate->css_currentScanDesc = currentScanDesc;
|
||||||
@ -959,7 +959,7 @@ ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent)
|
|||||||
direction, /* scan direction */
|
direction, /* scan direction */
|
||||||
timeQual, /* time qual */
|
timeQual, /* time qual */
|
||||||
&(relationDescs[i]), /* return: rel desc */
|
&(relationDescs[i]), /* return: rel desc */
|
||||||
(Pointer *) & (scanDescs[i]));
|
(Pointer *) &(scanDescs[i]));
|
||||||
/* return: scan desc */
|
/* return: scan desc */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -977,7 +977,7 @@ ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsIndexScan(IndexScan * node)
|
ExecCountSlotsIndexScan(IndexScan *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
|
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
|
||||||
ExecCountSlotsNode(innerPlan((Plan *) node)) +
|
ExecCountSlotsNode(innerPlan((Plan *) node)) +
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.8 1997/09/08 02:22:45 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.9 1997/09/08 21:43:14 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -48,7 +48,7 @@
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot * /* result tuple from subplan */
|
TupleTableSlot * /* result tuple from subplan */
|
||||||
ExecMaterial(Material * node)
|
ExecMaterial(Material *node)
|
||||||
{
|
{
|
||||||
EState *estate;
|
EState *estate;
|
||||||
MaterialState *matstate;
|
MaterialState *matstate;
|
||||||
@ -188,7 +188,7 @@ ExecMaterial(Material * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool /* initialization status */
|
bool /* initialization status */
|
||||||
ExecInitMaterial(Material * node, EState * estate, Plan * parent)
|
ExecInitMaterial(Material *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
MaterialState *matstate;
|
MaterialState *matstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -291,7 +291,7 @@ ExecInitMaterial(Material * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsMaterial(Material * node)
|
ExecCountSlotsMaterial(Material *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
|
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
|
||||||
ExecCountSlotsNode(innerPlan((Plan *) node)) +
|
ExecCountSlotsNode(innerPlan((Plan *) node)) +
|
||||||
@ -306,7 +306,7 @@ ExecCountSlotsMaterial(Material * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndMaterial(Material * node)
|
ExecEndMaterial(Material *node)
|
||||||
{
|
{
|
||||||
MaterialState *matstate;
|
MaterialState *matstate;
|
||||||
Relation tempRelation;
|
Relation tempRelation;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.11 1997/09/08 20:55:45 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.12 1997/09/08 21:43:15 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -84,7 +84,7 @@
|
|||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
#include "utils/psort.h"
|
#include "utils/psort.h"
|
||||||
|
|
||||||
static bool MergeCompare(List * eqQual, List * compareQual, ExprContext * econtext);
|
static bool MergeCompare(List *eqQual, List *compareQual, ExprContext *econtext);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
* MarkInnerTuple and RestoreInnerTuple macros
|
* MarkInnerTuple and RestoreInnerTuple macros
|
||||||
@ -143,7 +143,7 @@ static bool MergeCompare(List * eqQual, List * compareQual, ExprContext * econte
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static List *
|
static List *
|
||||||
MJFormOSortopI(List * qualList, Oid sortOp)
|
MJFormOSortopI(List *qualList, Oid sortOp)
|
||||||
{
|
{
|
||||||
List *qualCopy;
|
List *qualCopy;
|
||||||
List *qualcdr;
|
List *qualcdr;
|
||||||
@ -207,7 +207,7 @@ MJFormOSortopI(List * qualList, Oid sortOp)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static List *
|
static List *
|
||||||
MJFormISortopO(List * qualList, Oid sortOp)
|
MJFormISortopO(List *qualList, Oid sortOp)
|
||||||
{
|
{
|
||||||
List *ISortopO;
|
List *ISortopO;
|
||||||
List *qualcdr;
|
List *qualcdr;
|
||||||
@ -258,7 +258,7 @@ MJFormISortopO(List * qualList, Oid sortOp)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
MergeCompare(List * eqQual, List * compareQual, ExprContext * econtext)
|
MergeCompare(List *eqQual, List *compareQual, ExprContext *econtext)
|
||||||
{
|
{
|
||||||
List *clause;
|
List *clause;
|
||||||
List *eqclause;
|
List *eqclause;
|
||||||
@ -328,7 +328,7 @@ MergeCompare(List * eqQual, List * compareQual, ExprContext * econtext)
|
|||||||
*/
|
*/
|
||||||
#ifdef EXEC_MERGEJOINDEBUG
|
#ifdef EXEC_MERGEJOINDEBUG
|
||||||
void
|
void
|
||||||
ExecMergeTupleDumpInner(ExprContext * econtext)
|
ExecMergeTupleDumpInner(ExprContext *econtext)
|
||||||
{
|
{
|
||||||
TupleTableSlot *innerSlot;
|
TupleTableSlot *innerSlot;
|
||||||
|
|
||||||
@ -342,7 +342,7 @@ ExecMergeTupleDumpInner(ExprContext * econtext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExecMergeTupleDumpOuter(ExprContext * econtext)
|
ExecMergeTupleDumpOuter(ExprContext *econtext)
|
||||||
{
|
{
|
||||||
TupleTableSlot *outerSlot;
|
TupleTableSlot *outerSlot;
|
||||||
|
|
||||||
@ -356,8 +356,8 @@ ExecMergeTupleDumpOuter(ExprContext * econtext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExecMergeTupleDumpMarked(ExprContext * econtext,
|
ExecMergeTupleDumpMarked(ExprContext *econtext,
|
||||||
MergeJoinState * mergestate)
|
MergeJoinState *mergestate)
|
||||||
{
|
{
|
||||||
TupleTableSlot *markedSlot;
|
TupleTableSlot *markedSlot;
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ ExecMergeTupleDumpMarked(ExprContext * econtext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExecMergeTupleDump(ExprContext * econtext, MergeJoinState * mergestate)
|
ExecMergeTupleDump(ExprContext *econtext, MergeJoinState *mergestate)
|
||||||
{
|
{
|
||||||
printf("******** ExecMergeTupleDump ********\n");
|
printf("******** ExecMergeTupleDump ********\n");
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ ExecMergeTupleDump(ExprContext * econtext, MergeJoinState * mergestate)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CleanUpSort(Plan * plan)
|
CleanUpSort(Plan *plan)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (plan == NULL)
|
if (plan == NULL)
|
||||||
@ -449,7 +449,7 @@ CleanUpSort(Plan * plan)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecMergeJoin(MergeJoin * node)
|
ExecMergeJoin(MergeJoin *node)
|
||||||
{
|
{
|
||||||
EState *estate;
|
EState *estate;
|
||||||
MergeJoinState *mergestate;
|
MergeJoinState *mergestate;
|
||||||
@ -749,7 +749,8 @@ ExecMergeJoin(MergeJoin * node)
|
|||||||
*
|
*
|
||||||
* new outer tuple > marked tuple
|
* new outer tuple > marked tuple
|
||||||
*
|
*
|
||||||
******************************
|
*****************************
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -830,7 +831,8 @@ 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.
|
||||||
*
|
*
|
||||||
******************************
|
*****************************
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -933,7 +935,8 @@ 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.
|
||||||
*
|
*
|
||||||
******************************
|
*****************************
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -1065,7 +1068,7 @@ ExecMergeJoin(MergeJoin * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitMergeJoin(MergeJoin * node, EState * estate, Plan * parent)
|
ExecInitMergeJoin(MergeJoin *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
MergeJoinState *mergestate;
|
MergeJoinState *mergestate;
|
||||||
List *joinclauses;
|
List *joinclauses;
|
||||||
@ -1185,7 +1188,7 @@ ExecInitMergeJoin(MergeJoin * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsMergeJoin(MergeJoin * node)
|
ExecCountSlotsMergeJoin(MergeJoin *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
|
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
|
||||||
ExecCountSlotsNode(innerPlan((Plan *) node)) +
|
ExecCountSlotsNode(innerPlan((Plan *) node)) +
|
||||||
@ -1200,7 +1203,7 @@ ExecCountSlotsMergeJoin(MergeJoin * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndMergeJoin(MergeJoin * node)
|
ExecEndMergeJoin(MergeJoin *node)
|
||||||
{
|
{
|
||||||
MergeJoinState *mergestate;
|
MergeJoinState *mergestate;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.6 1997/09/08 20:55:46 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.7 1997/09/08 21:43:16 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -55,7 +55,7 @@
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecNestLoop(NestLoop * node, Plan * parent)
|
ExecNestLoop(NestLoop *node, Plan *parent)
|
||||||
{
|
{
|
||||||
NestLoopState *nlstate;
|
NestLoopState *nlstate;
|
||||||
Plan *innerPlan;
|
Plan *innerPlan;
|
||||||
@ -86,7 +86,7 @@ ExecNestLoop(NestLoop * node, Plan * parent)
|
|||||||
*/
|
*/
|
||||||
econtext = nlstate->jstate.cs_ExprContext;
|
econtext = nlstate->jstate.cs_ExprContext;
|
||||||
|
|
||||||
/* ---------------- * get the current outer tuple
|
/* ---------------- * get the current outer tuple
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
outerTupleSlot = nlstate->jstate.cs_OuterTupleSlot;
|
outerTupleSlot = nlstate->jstate.cs_OuterTupleSlot;
|
||||||
@ -265,7 +265,7 @@ ExecNestLoop(NestLoop * node, Plan * parent)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitNestLoop(NestLoop * node, EState * estate, Plan * parent)
|
ExecInitNestLoop(NestLoop *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
NestLoopState *nlstate;
|
NestLoopState *nlstate;
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ ExecInitNestLoop(NestLoop * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsNestLoop(NestLoop * node)
|
ExecCountSlotsNestLoop(NestLoop *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan(node)) +
|
return ExecCountSlotsNode(outerPlan(node)) +
|
||||||
ExecCountSlotsNode(innerPlan(node)) +
|
ExecCountSlotsNode(innerPlan(node)) +
|
||||||
@ -345,7 +345,7 @@ ExecCountSlotsNestLoop(NestLoop * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndNestLoop(NestLoop * node)
|
ExecEndNestLoop(NestLoop *node)
|
||||||
{
|
{
|
||||||
NestLoopState *nlstate;
|
NestLoopState *nlstate;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* SeqScan (emp.all)
|
* SeqScan (emp.all)
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeResult.c,v 1.4 1997/09/08 02:22:49 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeResult.c,v 1.5 1997/09/08 21:43:16 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -51,7 +51,7 @@
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecResult(Result * node)
|
ExecResult(Result *node)
|
||||||
{
|
{
|
||||||
ResultState *resstate;
|
ResultState *resstate;
|
||||||
TupleTableSlot *outerTupleSlot;
|
TupleTableSlot *outerTupleSlot;
|
||||||
@ -189,7 +189,7 @@ ExecResult(Result * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitResult(Result * node, EState * estate, Plan * parent)
|
ExecInitResult(Result *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
ResultState *resstate;
|
ResultState *resstate;
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ ExecInitResult(Result * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsResult(Result * node)
|
ExecCountSlotsResult(Result *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan(node)) + RESULT_NSLOTS;
|
return ExecCountSlotsNode(outerPlan(node)) + RESULT_NSLOTS;
|
||||||
}
|
}
|
||||||
@ -265,7 +265,7 @@ ExecCountSlotsResult(Result * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndResult(Result * node)
|
ExecEndResult(Result *node)
|
||||||
{
|
{
|
||||||
ResultState *resstate;
|
ResultState *resstate;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.6 1997/09/08 02:22:50 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.7 1997/09/08 21:43:17 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -31,10 +31,10 @@
|
|||||||
#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);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
* Scan Support
|
* Scan Support
|
||||||
@ -47,7 +47,7 @@ static TupleTableSlot *SeqNext(SeqScan * node);
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static TupleTableSlot *
|
static TupleTableSlot *
|
||||||
SeqNext(SeqScan * node)
|
SeqNext(SeqScan *node)
|
||||||
{
|
{
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
HeapScanDesc scandesc;
|
HeapScanDesc scandesc;
|
||||||
@ -115,7 +115,7 @@ SeqNext(SeqScan * node)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecSeqScan(SeqScan * node)
|
ExecSeqScan(SeqScan *node)
|
||||||
{
|
{
|
||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -151,8 +151,8 @@ ExecSeqScan(SeqScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static Oid
|
static Oid
|
||||||
InitScanRelation(SeqScan * node, EState * estate,
|
InitScanRelation(SeqScan *node, EState *estate,
|
||||||
CommonScanState * scanstate, Plan * outerPlan)
|
CommonScanState *scanstate, Plan *outerPlan)
|
||||||
{
|
{
|
||||||
Index relid;
|
Index relid;
|
||||||
List *rangeTable;
|
List *rangeTable;
|
||||||
@ -190,7 +190,7 @@ InitScanRelation(SeqScan * node, EState * estate,
|
|||||||
direction,/* scan direction */
|
direction,/* scan direction */
|
||||||
timeQual, /* time qual */
|
timeQual, /* time qual */
|
||||||
¤tRelation, /* return: rel desc */
|
¤tRelation, /* return: rel desc */
|
||||||
(Pointer *) & currentScanDesc); /* return: scan desc */
|
(Pointer *) ¤tScanDesc); /* return: scan desc */
|
||||||
|
|
||||||
scanstate->css_currentRelation = currentRelation;
|
scanstate->css_currentRelation = currentRelation;
|
||||||
scanstate->css_currentScanDesc = currentScanDesc;
|
scanstate->css_currentScanDesc = currentScanDesc;
|
||||||
@ -236,7 +236,7 @@ InitScanRelation(SeqScan * node, EState * estate,
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitSeqScan(SeqScan * node, EState * estate, Plan * parent)
|
ExecInitSeqScan(SeqScan *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -296,7 +296,7 @@ ExecInitSeqScan(SeqScan * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsSeqScan(SeqScan * node)
|
ExecCountSlotsSeqScan(SeqScan *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan(node)) +
|
return ExecCountSlotsNode(outerPlan(node)) +
|
||||||
ExecCountSlotsNode(innerPlan(node)) +
|
ExecCountSlotsNode(innerPlan(node)) +
|
||||||
@ -312,7 +312,7 @@ ExecCountSlotsSeqScan(SeqScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndSeqScan(SeqScan * node)
|
ExecEndSeqScan(SeqScan *node)
|
||||||
{
|
{
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -366,7 +366,7 @@ ExecEndSeqScan(SeqScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecSeqReScan(SeqScan * node, ExprContext * exprCtxt, Plan * parent)
|
ExecSeqReScan(SeqScan *node, ExprContext *exprCtxt, Plan *parent)
|
||||||
{
|
{
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
EState *estate;
|
EState *estate;
|
||||||
@ -403,7 +403,7 @@ ExecSeqReScan(SeqScan * node, ExprContext * exprCtxt, Plan * parent)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecSeqMarkPos(SeqScan * node)
|
ExecSeqMarkPos(SeqScan *node)
|
||||||
{
|
{
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -442,7 +442,7 @@ ExecSeqMarkPos(SeqScan * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecSeqRestrPos(SeqScan * node)
|
ExecSeqRestrPos(SeqScan *node)
|
||||||
{
|
{
|
||||||
CommonScanState *scanstate;
|
CommonScanState *scanstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.8 1997/09/08 02:22:50 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.9 1997/09/08 21:43:19 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -33,7 +33,7 @@
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static ScanKey
|
static ScanKey
|
||||||
FormSortKeys(Sort * sortnode)
|
FormSortKeys(Sort *sortnode)
|
||||||
{
|
{
|
||||||
ScanKey sortkeys;
|
ScanKey sortkeys;
|
||||||
List *targetList;
|
List *targetList;
|
||||||
@ -102,7 +102,7 @@ FormSortKeys(Sort * sortnode)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecSort(Sort * node)
|
ExecSort(Sort *node)
|
||||||
{
|
{
|
||||||
EState *estate;
|
EState *estate;
|
||||||
SortState *sortstate;
|
SortState *sortstate;
|
||||||
@ -229,7 +229,7 @@ ExecSort(Sort * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitSort(Sort * node, EState * estate, Plan * parent)
|
ExecInitSort(Sort *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
SortState *sortstate;
|
SortState *sortstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -314,7 +314,7 @@ ExecInitSort(Sort * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsSort(Sort * node)
|
ExecCountSlotsSort(Sort *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
|
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
|
||||||
ExecCountSlotsNode(innerPlan((Plan *) node)) +
|
ExecCountSlotsNode(innerPlan((Plan *) node)) +
|
||||||
@ -328,7 +328,7 @@ ExecCountSlotsSort(Sort * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndSort(Sort * node)
|
ExecEndSort(Sort *node)
|
||||||
{
|
{
|
||||||
SortState *sortstate;
|
SortState *sortstate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -369,7 +369,7 @@ ExecEndSort(Sort * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecSortMarkPos(Sort * node)
|
ExecSortMarkPos(Sort *node)
|
||||||
{
|
{
|
||||||
SortState *sortstate;
|
SortState *sortstate;
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ ExecSortMarkPos(Sort * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecSortRestrPos(Sort * node)
|
ExecSortRestrPos(Sort *node)
|
||||||
{
|
{
|
||||||
SortState *sortstate;
|
SortState *sortstate;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* ExecEndTee
|
* ExecEndTee
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.8 1997/09/08 02:22:51 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.9 1997/09/08 21:43:20 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -45,7 +45,7 @@
|
|||||||
* ------------------------------------------------------------------
|
* ------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ExecInitTee(Tee * node, EState * currentEstate, Plan * parent)
|
ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
|
||||||
{
|
{
|
||||||
TeeState *teeState;
|
TeeState *teeState;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -214,7 +214,7 @@ ExecInitTee(Tee * node, EState * currentEstate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsTee(Tee * node)
|
ExecCountSlotsTee(Tee *node)
|
||||||
{
|
{
|
||||||
/* Tee nodes can't have innerPlans */
|
/* Tee nodes can't have innerPlans */
|
||||||
return ExecCountSlotsNode(outerPlan(node)) + TEE_NSLOTS;
|
return ExecCountSlotsNode(outerPlan(node)) + TEE_NSLOTS;
|
||||||
@ -230,7 +230,7 @@ ExecCountSlotsTee(Tee * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
initTeeScanDescs(Tee * node)
|
initTeeScanDescs(Tee *node)
|
||||||
{
|
{
|
||||||
TeeState *teeState;
|
TeeState *teeState;
|
||||||
Relation bufferRel;
|
Relation bufferRel;
|
||||||
@ -290,7 +290,7 @@ initTeeScanDescs(Tee * node)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
TupleTableSlot *
|
TupleTableSlot *
|
||||||
ExecTee(Tee * node, Plan * parent)
|
ExecTee(Tee *node, Plan *parent)
|
||||||
{
|
{
|
||||||
EState *estate;
|
EState *estate;
|
||||||
TeeState *teeState;
|
TeeState *teeState;
|
||||||
@ -443,7 +443,7 @@ ExecTee(Tee * node, Plan * parent)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecTeeReScan(Tee * node, ExprContext * exprCtxt, Plan * parent)
|
ExecTeeReScan(Tee *node, ExprContext *exprCtxt, Plan *parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
EState *estate;
|
EState *estate;
|
||||||
@ -490,7 +490,7 @@ ExecTeeReScan(Tee * node, ExprContext * exprCtxt, Plan * parent)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
ExecEndTee(Tee * node, Plan * parent)
|
ExecEndTee(Tee *node, Plan *parent)
|
||||||
{
|
{
|
||||||
EState *estate;
|
EState *estate;
|
||||||
TeeState *teeState;
|
TeeState *teeState;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.9 1997/09/08 02:22:52 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.10 1997/09/08 21:43:21 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -47,9 +47,9 @@
|
|||||||
* same ADT value. -cim
|
* same ADT value. -cim
|
||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
static bool /* true if tuples are identical, false
|
static bool /* true if tuples are identical, false
|
||||||
* otherwise */
|
* otherwise */
|
||||||
ExecIdenticalTuples(TupleTableSlot * t1, TupleTableSlot * t2)
|
ExecIdenticalTuples(TupleTableSlot *t1, TupleTableSlot *t2)
|
||||||
{
|
{
|
||||||
HeapTuple h1;
|
HeapTuple h1;
|
||||||
HeapTuple h2;
|
HeapTuple h2;
|
||||||
@ -108,7 +108,7 @@ ExecIdenticalTuples(TupleTableSlot * t1, TupleTableSlot * t2)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
TupleTableSlot * /* return: a tuple or NULL */
|
TupleTableSlot * /* return: a tuple or NULL */
|
||||||
ExecUnique(Unique * node)
|
ExecUnique(Unique *node)
|
||||||
{
|
{
|
||||||
UniqueState *uniquestate;
|
UniqueState *uniquestate;
|
||||||
TupleTableSlot *resultTupleSlot;
|
TupleTableSlot *resultTupleSlot;
|
||||||
@ -243,7 +243,7 @@ ExecUnique(Unique * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
bool /* return: initialization status */
|
bool /* return: initialization status */
|
||||||
ExecInitUnique(Unique * node, EState * estate, Plan * parent)
|
ExecInitUnique(Unique *node, EState *estate, Plan *parent)
|
||||||
{
|
{
|
||||||
UniqueState *uniquestate;
|
UniqueState *uniquestate;
|
||||||
Plan *outerPlan;
|
Plan *outerPlan;
|
||||||
@ -323,7 +323,7 @@ ExecInitUnique(Unique * node, EState * estate, Plan * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCountSlotsUnique(Unique * node)
|
ExecCountSlotsUnique(Unique *node)
|
||||||
{
|
{
|
||||||
return ExecCountSlotsNode(outerPlan(node)) +
|
return ExecCountSlotsNode(outerPlan(node)) +
|
||||||
ExecCountSlotsNode(innerPlan(node)) +
|
ExecCountSlotsNode(innerPlan(node)) +
|
||||||
@ -338,7 +338,7 @@ ExecCountSlotsUnique(Unique * node)
|
|||||||
* ----------------------------------------------------------------
|
* ----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ExecEndUnique(Unique * node)
|
ExecEndUnique(Unique *node)
|
||||||
{
|
{
|
||||||
UniqueState *uniquestate;
|
UniqueState *uniquestate;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ typedef struct
|
|||||||
Portal portal; /* portal per procedure */
|
Portal portal; /* portal per procedure */
|
||||||
MemoryContext savedcxt;
|
MemoryContext savedcxt;
|
||||||
CommandId savedId;
|
CommandId savedId;
|
||||||
} _SPI_connection;
|
} _SPI_connection;
|
||||||
|
|
||||||
static Portal _SPI_portal = (Portal) NULL;
|
static Portal _SPI_portal = (Portal) NULL;
|
||||||
static _SPI_connection *_SPI_stack = NULL;
|
static _SPI_connection *_SPI_stack = NULL;
|
||||||
@ -37,20 +37,20 @@ typedef struct
|
|||||||
List *ptlist;
|
List *ptlist;
|
||||||
int nargs;
|
int nargs;
|
||||||
Oid *argtypes;
|
Oid *argtypes;
|
||||||
} _SPI_plan;
|
} _SPI_plan;
|
||||||
|
|
||||||
static int _SPI_execute(char *src, int tcount, _SPI_plan * plan);
|
static int _SPI_execute(char *src, int tcount, _SPI_plan *plan);
|
||||||
static int _SPI_pquery(QueryDesc * queryDesc, EState * state, int tcount);
|
static int _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
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,
|
||||||
char **Values, char *Nulls, int tcount);
|
char **Values, char *Nulls, int tcount);
|
||||||
|
|
||||||
static _SPI_plan *_SPI_copy_plan(_SPI_plan * plan, bool local);
|
static _SPI_plan *_SPI_copy_plan(_SPI_plan *plan, bool local);
|
||||||
|
|
||||||
static int _SPI_begin_call(bool execmem);
|
static int _SPI_begin_call(bool execmem);
|
||||||
static int _SPI_end_call(bool procmem);
|
static int _SPI_end_call(bool procmem);
|
||||||
@ -217,7 +217,7 @@ SPI_execp(void *plan, char **Values, char *Nulls, int tcount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
SPI_prepare(char *src, int nargs, Oid * argtypes)
|
SPI_prepare(char *src, int nargs, Oid *argtypes)
|
||||||
{
|
{
|
||||||
_SPI_plan *plan;
|
_SPI_plan *plan;
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
|
SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull)
|
||||||
{
|
{
|
||||||
char *val;
|
char *val;
|
||||||
|
|
||||||
@ -457,7 +457,7 @@ spi_printtup(HeapTuple tuple, TupleDesc tupdesc)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_SPI_execute(char *src, int tcount, _SPI_plan * plan)
|
_SPI_execute(char *src, int tcount, _SPI_plan *plan)
|
||||||
{
|
{
|
||||||
QueryTreeList *queryTree_list;
|
QueryTreeList *queryTree_list;
|
||||||
List *planTree_list;
|
List *planTree_list;
|
||||||
@ -554,7 +554,7 @@ _SPI_execute(char *src, int tcount, _SPI_plan * plan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_SPI_execute_plan(_SPI_plan * plan, char **Values, char *Nulls, int tcount)
|
_SPI_execute_plan(_SPI_plan *plan, char **Values, char *Nulls, int tcount)
|
||||||
{
|
{
|
||||||
QueryTreeList *queryTree_list = plan->qtlist;
|
QueryTreeList *queryTree_list = plan->qtlist;
|
||||||
List *planTree_list = plan->ptlist;
|
List *planTree_list = plan->ptlist;
|
||||||
@ -625,7 +625,7 @@ _SPI_execute_plan(_SPI_plan * plan, char **Values, char *Nulls, int tcount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_SPI_pquery(QueryDesc * queryDesc, EState * state, int tcount)
|
_SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount)
|
||||||
{
|
{
|
||||||
Query *parseTree;
|
Query *parseTree;
|
||||||
Plan *plan;
|
Plan *plan;
|
||||||
@ -723,7 +723,7 @@ _SPI_pquery(QueryDesc * queryDesc, EState * state, int tcount)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
_SPI_fetch(FetchStmt * stmt)
|
_SPI_fetch(FetchStmt *stmt)
|
||||||
{
|
{
|
||||||
char *name = stmt->portalname;
|
char *name = stmt->portalname;
|
||||||
int feature = (stmt->direction == FORWARD) ? EXEC_FOR : EXEC_BACK;
|
int feature = (stmt->direction == FORWARD) ? EXEC_FOR : EXEC_BACK;
|
||||||
@ -864,7 +864,7 @@ _SPI_checktuples(bool isRetrieveIntoRelation)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static _SPI_plan *
|
static _SPI_plan *
|
||||||
_SPI_copy_plan(_SPI_plan * plan, bool local)
|
_SPI_copy_plan(_SPI_plan *plan, bool local)
|
||||||
{
|
{
|
||||||
_SPI_plan *newplan;
|
_SPI_plan *newplan;
|
||||||
MemoryContext oldcxt;
|
MemoryContext oldcxt;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.7 1997/09/08 02:22:56 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.8 1997/09/08 21:43:27 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -32,7 +32,7 @@ DLNewList(void)
|
|||||||
|
|
||||||
/* free up a list and all the nodes in it */
|
/* free up a list and all the nodes in it */
|
||||||
void
|
void
|
||||||
DLFreeList(Dllist * l)
|
DLFreeList(Dllist *l)
|
||||||
{
|
{
|
||||||
Dlelem *curr;
|
Dlelem *curr;
|
||||||
|
|
||||||
@ -56,13 +56,13 @@ DLNewElem(void *val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DLFreeElem(Dlelem * e)
|
DLFreeElem(Dlelem *e)
|
||||||
{
|
{
|
||||||
free(e);
|
free(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dlelem *
|
Dlelem *
|
||||||
DLGetHead(Dllist * l)
|
DLGetHead(Dllist *l)
|
||||||
{
|
{
|
||||||
return (l ? l->dll_head : 0);
|
return (l ? l->dll_head : 0);
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ DLGetHead(Dllist * l)
|
|||||||
/* get the value stored in the first element */
|
/* get the value stored in the first element */
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
void *
|
void *
|
||||||
DLGetHeadVal(Dllist * l)
|
DLGetHeadVal(Dllist *l)
|
||||||
{
|
{
|
||||||
Dlelem *e = DLGetHead(l);
|
Dlelem *e = DLGetHead(l);
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ DLGetHeadVal(Dllist * l)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Dlelem *
|
Dlelem *
|
||||||
DLGetTail(Dllist * l)
|
DLGetTail(Dllist *l)
|
||||||
{
|
{
|
||||||
return (l ? l->dll_tail : 0);
|
return (l ? l->dll_tail : 0);
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ DLGetTail(Dllist * l)
|
|||||||
/* get the value stored in the first element */
|
/* get the value stored in the first element */
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
void *
|
void *
|
||||||
DLGetTailVal(Dllist * l)
|
DLGetTailVal(Dllist *l)
|
||||||
{
|
{
|
||||||
Dlelem *e = DLGetTail(l);
|
Dlelem *e = DLGetTail(l);
|
||||||
|
|
||||||
@ -98,19 +98,19 @@ DLGetTailVal(Dllist * l)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Dlelem *
|
Dlelem *
|
||||||
DLGetPred(Dlelem * e) /* get predecessor */
|
DLGetPred(Dlelem *e) /* get predecessor */
|
||||||
{
|
{
|
||||||
return (e ? e->dle_prev : 0);
|
return (e ? e->dle_prev : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dlelem *
|
Dlelem *
|
||||||
DLGetSucc(Dlelem * e) /* get successor */
|
DLGetSucc(Dlelem *e) /* get successor */
|
||||||
{
|
{
|
||||||
return (e ? e->dle_next : 0);
|
return (e ? e->dle_next : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DLRemove(Dlelem * e)
|
DLRemove(Dlelem *e)
|
||||||
{
|
{
|
||||||
Dllist *l;
|
Dllist *l;
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ DLRemove(Dlelem * e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DLAddHead(Dllist * l, Dlelem * e)
|
DLAddHead(Dllist *l, Dlelem *e)
|
||||||
{
|
{
|
||||||
e->dle_list = l;
|
e->dle_list = l;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ DLAddHead(Dllist * l, Dlelem * e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DLAddTail(Dllist * l, Dlelem * e)
|
DLAddTail(Dllist *l, Dlelem *e)
|
||||||
{
|
{
|
||||||
e->dle_list = l;
|
e->dle_list = l;
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ DLAddTail(Dllist * l, Dlelem * e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Dlelem *
|
Dlelem *
|
||||||
DLRemHead(Dllist * l)
|
DLRemHead(Dllist *l)
|
||||||
{
|
{
|
||||||
/* remove and return the head */
|
/* remove and return the head */
|
||||||
Dlelem *result;
|
Dlelem *result;
|
||||||
@ -189,7 +189,7 @@ DLRemHead(Dllist * l)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Dlelem *
|
Dlelem *
|
||||||
DLRemTail(Dllist * l)
|
DLRemTail(Dllist *l)
|
||||||
{
|
{
|
||||||
/* remove and return the tail */
|
/* remove and return the tail */
|
||||||
Dlelem *result;
|
Dlelem *result;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/lib/Attic/hasht.c,v 1.6 1997/09/08 02:22:59 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/lib/Attic/hasht.c,v 1.7 1997/09/08 21:43:29 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -26,7 +26,7 @@
|
|||||||
* -----------------------------------
|
* -----------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
HashTableWalk(HTAB * hashtable, HashtFunc function, int arg)
|
HashTableWalk(HTAB *hashtable, HashtFunc function, int arg)
|
||||||
{
|
{
|
||||||
long *hashent;
|
long *hashent;
|
||||||
long *data;
|
long *data;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/lib/Attic/lispsort.c,v 1.6 1997/09/08 02:23:02 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/lib/Attic/lispsort.c,v 1.7 1997/09/08 21:43:31 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -30,7 +30,7 @@
|
|||||||
** the nodes sorted. The old list is *not* freed or modified (?)
|
** the nodes sorted. The old list is *not* freed or modified (?)
|
||||||
*/
|
*/
|
||||||
List *
|
List *
|
||||||
lisp_qsort(List * the_list, /* the list to be sorted */
|
lisp_qsort(List *the_list, /* the list to be sorted */
|
||||||
int (*compare) ()) /* function to compare two nodes */
|
int (*compare) ()) /* function to compare two nodes */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.16 1997/09/08 02:23:06 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.17 1997/09/08 21:43:34 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -424,7 +424,7 @@ pg_krb5_recvauth(int sock,
|
|||||||
#endif /* KRB5 */
|
#endif /* KRB5 */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pg_password_recvauth(Port * port, char *database, char *DataDir)
|
pg_password_recvauth(Port *port, char *database, char *DataDir)
|
||||||
{
|
{
|
||||||
PacketBuf buf;
|
PacketBuf buf;
|
||||||
char *user,
|
char *user,
|
||||||
@ -449,7 +449,7 @@ pg_password_recvauth(Port * port, char *database, char *DataDir)
|
|||||||
* be_recvauth -- server demux routine for incoming authentication information
|
* be_recvauth -- server demux routine for incoming authentication information
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
be_recvauth(MsgType msgtype_arg, Port * port, char *username, StartupInfo * sp)
|
be_recvauth(MsgType msgtype_arg, Port *port, char *username, StartupInfo *sp)
|
||||||
{
|
{
|
||||||
MsgType msgtype;
|
MsgType msgtype;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.7 1997/09/08 02:23:09 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.8 1997/09/08 21:43:39 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -73,7 +73,7 @@ be_portalinit(void)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
be_portalpush(PortalEntry * entry)
|
be_portalpush(PortalEntry *entry)
|
||||||
{
|
{
|
||||||
DLAddTail(be_portalstack, DLNewElem(entry));
|
DLAddTail(be_portalstack, DLNewElem(entry));
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ be_newportal(void)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
be_typeinit(PortalEntry * entry,
|
be_typeinit(PortalEntry *entry,
|
||||||
TupleDesc tupDesc,
|
TupleDesc tupDesc,
|
||||||
int natts)
|
int natts)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.14 1997/09/08 02:23:10 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.15 1997/09/08 21:43:41 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
|
||||||
@ -49,7 +49,7 @@ static LargeObjectDesc *cookies[MAX_LOBJ_FDS];
|
|||||||
static GlobalMemory fscxt = NULL;
|
static GlobalMemory fscxt = NULL;
|
||||||
|
|
||||||
|
|
||||||
static int newLOfd(LargeObjectDesc * lobjCookie);
|
static int newLOfd(LargeObjectDesc *lobjCookie);
|
||||||
static void deleteLOfd(int fd);
|
static void deleteLOfd(int fd);
|
||||||
|
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ lowrite(int fd, struct varlena * wbuf)
|
|||||||
* imports a file as an (inversion) large object.
|
* imports a file as an (inversion) large object.
|
||||||
*/
|
*/
|
||||||
Oid
|
Oid
|
||||||
lo_import(text * filename)
|
lo_import(text *filename)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int nbytes,
|
int nbytes,
|
||||||
@ -317,7 +317,7 @@ lo_import(text * filename)
|
|||||||
* exports an (inversion) large object.
|
* exports an (inversion) large object.
|
||||||
*/
|
*/
|
||||||
int4
|
int4
|
||||||
lo_export(Oid lobjId, text * filename)
|
lo_export(Oid lobjId, text *filename)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int nbytes,
|
int nbytes,
|
||||||
@ -377,7 +377,7 @@ lo_export(Oid lobjId, text * filename)
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
newLOfd(LargeObjectDesc * lobjCookie)
|
newLOfd(LargeObjectDesc *lobjCookie)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.6 1997/09/08 02:23:11 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.7 1997/09/08 21:43:43 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -63,7 +63,7 @@ PQfn(int fnid,
|
|||||||
int *result_buf, /* can't use void, dec compiler barfs */
|
int *result_buf, /* can't use void, dec compiler barfs */
|
||||||
int result_len,
|
int result_len,
|
||||||
int result_is_int,
|
int result_is_int,
|
||||||
PQArgBlock * args,
|
PQArgBlock *args,
|
||||||
int nargs)
|
int nargs)
|
||||||
{
|
{
|
||||||
char *retval; /* XXX - should be datum, maybe ? */
|
char *retval; /* XXX - should be datum, maybe ? */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.21 1997/09/08 02:23:12 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.22 1997/09/08 21:43:45 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -42,7 +42,7 @@ isblank(const char c)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
next_token(FILE * fp, char *buf, const int bufsz)
|
next_token(FILE *fp, char *buf, const int bufsz)
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
Grab one token out of fp. Tokens are strings of non-blank
|
Grab one token out of fp. Tokens are strings of non-blank
|
||||||
@ -85,7 +85,7 @@ next_token(FILE * fp, char *buf, const int bufsz)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_through_eol(FILE * file)
|
read_through_eol(FILE *file)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
@ -97,8 +97,8 @@ read_through_eol(FILE * file)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_hba_entry2(FILE * file, enum Userauth * userauth_p, char usermap_name[],
|
read_hba_entry2(FILE *file, enum Userauth * userauth_p, char usermap_name[],
|
||||||
bool * error_p, bool * matches_p, bool find_password_entries)
|
bool *error_p, bool *matches_p, bool find_password_entries)
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
Read from file FILE the rest of a host record, after the mask field,
|
Read from file FILE the rest of a host record, after the mask field,
|
||||||
@ -182,9 +182,9 @@ read_hba_entry2(FILE * file, enum Userauth * userauth_p, char usermap_name[],
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
process_hba_record(FILE * file,
|
process_hba_record(FILE *file,
|
||||||
const struct in_addr ip_addr, const char database[],
|
const struct in_addr ip_addr, const char database[],
|
||||||
bool * matches_p, bool * error_p,
|
bool *matches_p, bool *error_p,
|
||||||
enum Userauth * userauth_p, char usermap_name[],
|
enum Userauth * userauth_p, char usermap_name[],
|
||||||
bool find_password_entries)
|
bool find_password_entries)
|
||||||
{
|
{
|
||||||
@ -311,9 +311,9 @@ process_hba_record(FILE * file,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
process_open_config_file(FILE * file,
|
process_open_config_file(FILE *file,
|
||||||
const struct in_addr ip_addr, const char database[],
|
const struct in_addr ip_addr, const char database[],
|
||||||
bool * host_ok_p, enum Userauth * userauth_p,
|
bool *host_ok_p, enum Userauth * userauth_p,
|
||||||
char usermap_name[], bool find_password_entries)
|
char usermap_name[], bool find_password_entries)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
@ -370,7 +370,7 @@ process_open_config_file(FILE * file,
|
|||||||
void
|
void
|
||||||
find_hba_entry(const char DataDir[], const struct in_addr ip_addr,
|
find_hba_entry(const char DataDir[], const struct in_addr ip_addr,
|
||||||
const char database[],
|
const char database[],
|
||||||
bool * host_ok_p, enum Userauth * userauth_p,
|
bool *host_ok_p, enum Userauth * userauth_p,
|
||||||
char usermap_name[], bool find_password_entries)
|
char usermap_name[], bool find_password_entries)
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
@ -461,7 +461,7 @@ find_hba_entry(const char DataDir[], const struct in_addr ip_addr,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
interpret_ident_response(char ident_response[],
|
interpret_ident_response(char ident_response[],
|
||||||
bool * error_p, char ident_username[])
|
bool *error_p, char ident_username[])
|
||||||
{
|
{
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
Parse the string "ident_response[]" as a response from a query to an Ident
|
Parse the string "ident_response[]" as a response from a query to an Ident
|
||||||
@ -549,7 +549,7 @@ interpret_ident_response(char ident_response[],
|
|||||||
static void
|
static void
|
||||||
ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
|
ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
|
||||||
const ushort remote_port, const ushort local_port,
|
const ushort remote_port, const ushort local_port,
|
||||||
bool * ident_failed, char ident_username[])
|
bool *ident_failed, char ident_username[])
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
Talk to the ident server on host "remote_ip_addr" and find out who
|
Talk to the ident server on host "remote_ip_addr" and find out who
|
||||||
@ -661,7 +661,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_map_record(FILE * file,
|
parse_map_record(FILE *file,
|
||||||
char file_map[], char file_pguser[], char file_iuser[])
|
char file_map[], char file_pguser[], char file_iuser[])
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
@ -702,11 +702,11 @@ parse_map_record(FILE * file,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
verify_against_open_usermap(FILE * file,
|
verify_against_open_usermap(FILE *file,
|
||||||
const char pguser[],
|
const char pguser[],
|
||||||
const char ident_username[],
|
const char ident_username[],
|
||||||
const char usermap_name[],
|
const char usermap_name[],
|
||||||
bool * checks_out_p)
|
bool *checks_out_p)
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
This function does the same thing as verify_against_usermap,
|
This function does the same thing as verify_against_usermap,
|
||||||
@ -758,7 +758,7 @@ verify_against_usermap(const char DataDir[],
|
|||||||
const char pguser[],
|
const char pguser[],
|
||||||
const char ident_username[],
|
const char ident_username[],
|
||||||
const char usermap_name[],
|
const char usermap_name[],
|
||||||
bool * checks_out_p)
|
bool *checks_out_p)
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
See if the user with ident username "ident_username" is allowed to act
|
See if the user with ident username "ident_username" is allowed to act
|
||||||
@ -838,7 +838,7 @@ static void
|
|||||||
authident(const char DataDir[],
|
authident(const char DataDir[],
|
||||||
const Port port, const char postgres_username[],
|
const Port port, const char postgres_username[],
|
||||||
const char usermap_name[],
|
const char usermap_name[],
|
||||||
bool * authentic_p)
|
bool *authentic_p)
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
Talk to the ident server on the remote host and find out who owns the
|
Talk to the ident server on the remote host and find out who owns the
|
||||||
@ -878,7 +878,7 @@ authident(const char DataDir[],
|
|||||||
|
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
hba_recvauth(const Port * port, const char database[], const char user[],
|
hba_recvauth(const Port *port, const char database[], const char user[],
|
||||||
const char DataDir[])
|
const char DataDir[])
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
@ -923,7 +923,7 @@ hba_recvauth(const Port * port, const char database[], const char user[],
|
|||||||
case Trust:
|
case Trust:
|
||||||
retvalue = STATUS_OK;
|
retvalue = STATUS_OK;
|
||||||
break;
|
break;
|
||||||
case Ident:
|
case Ident:
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -934,14 +934,15 @@ hba_recvauth(const Port * port, const char database[], const char user[],
|
|||||||
bool authentic; /* He is who he says he
|
bool authentic; /* He is who he says he
|
||||||
* is. */
|
* is. */
|
||||||
|
|
||||||
authident(DataDir, *port, user, usermap_name, &authentic);
|
authident(DataDir, *port, user, usermap_name, &authentic);
|
||||||
|
|
||||||
if (authentic)
|
if (authentic)
|
||||||
retvalue = STATUS_OK;
|
retvalue = STATUS_OK;
|
||||||
else
|
else
|
||||||
retvalue = STATUS_ERROR;
|
retvalue = STATUS_ERROR;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
retvalue = STATUS_ERROR;
|
retvalue = STATUS_ERROR;
|
||||||
Assert(false);
|
Assert(false);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
verify_password(char *user, char *password, Port * port,
|
verify_password(char *user, char *password, Port *port,
|
||||||
char *database, char *DataDir)
|
char *database, char *DataDir)
|
||||||
{
|
{
|
||||||
bool host_ok;
|
bool host_ok;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.8 1997/09/08 02:23:14 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.9 1997/09/08 21:43:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -183,7 +183,7 @@ PQparray(char *pname)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQrulep(PortalBuffer * portal)
|
PQrulep(PortalBuffer *portal)
|
||||||
{
|
{
|
||||||
if (!valid_pointer("PQrulep: invalid portal pointer", portal))
|
if (!valid_pointer("PQrulep: invalid portal pointer", portal))
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -196,7 +196,7 @@ PQrulep(PortalBuffer * portal)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQntuples(PortalBuffer * portal)
|
PQntuples(PortalBuffer *portal)
|
||||||
{
|
{
|
||||||
if (!valid_pointer("PQntuples: invalid portal pointer", portal))
|
if (!valid_pointer("PQntuples: invalid portal pointer", portal))
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -205,7 +205,7 @@ PQntuples(PortalBuffer * portal)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
PQninstances(PortalBuffer * portal)
|
PQninstances(PortalBuffer *portal)
|
||||||
{
|
{
|
||||||
return (PQntuples(portal));
|
return (PQntuples(portal));
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ PQninstances(PortalBuffer * portal)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQngroups(PortalBuffer * portal)
|
PQngroups(PortalBuffer *portal)
|
||||||
{
|
{
|
||||||
if (!valid_pointer("PQngroups: invalid portal pointer", portal))
|
if (!valid_pointer("PQngroups: invalid portal pointer", portal))
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -228,7 +228,7 @@ PQngroups(PortalBuffer * portal)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQntuplesGroup(PortalBuffer * portal, int group_index)
|
PQntuplesGroup(PortalBuffer *portal, int group_index)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ PQntuplesGroup(PortalBuffer * portal, int group_index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
PQninstancesGroup(PortalBuffer * portal, int group_index)
|
PQninstancesGroup(PortalBuffer *portal, int group_index)
|
||||||
{
|
{
|
||||||
return (PQntuplesGroup(portal, group_index));
|
return (PQntuplesGroup(portal, group_index));
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ PQninstancesGroup(PortalBuffer * portal, int group_index)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQnfieldsGroup(PortalBuffer * portal, int group_index)
|
PQnfieldsGroup(PortalBuffer *portal, int group_index)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ PQnfieldsGroup(PortalBuffer * portal, int group_index)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQfnumberGroup(PortalBuffer * portal, int group_index, char *field_name)
|
PQfnumberGroup(PortalBuffer *portal, int group_index, char *field_name)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ PQfnumberGroup(PortalBuffer * portal, int group_index, char *field_name)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
PQfnameGroup(PortalBuffer * portal, int group_index, int field_number)
|
PQfnameGroup(PortalBuffer *portal, int group_index, int field_number)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ PQfnameGroup(PortalBuffer * portal, int group_index, int field_number)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQftypeGroup(PortalBuffer * portal, int group_index, int field_number)
|
PQftypeGroup(PortalBuffer *portal, int group_index, int field_number)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ PQftypeGroup(PortalBuffer * portal, int group_index, int field_number)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQfsizeGroup(PortalBuffer * portal, int group_index, int field_number)
|
PQfsizeGroup(PortalBuffer *portal, int group_index, int field_number)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ PQfsizeGroup(PortalBuffer * portal, int group_index, int field_number)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
GroupBuffer *
|
GroupBuffer *
|
||||||
PQgroup(PortalBuffer * portal, int tuple_index)
|
PQgroup(PortalBuffer *portal, int tuple_index)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
int tuple_count = 0;
|
int tuple_count = 0;
|
||||||
@ -386,7 +386,7 @@ PQgroup(PortalBuffer * portal, int tuple_index)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQgetgroup(PortalBuffer * portal, int tuple_index)
|
PQgetgroup(PortalBuffer *portal, int tuple_index)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
int tuple_count = 0,
|
int tuple_count = 0,
|
||||||
@ -412,7 +412,7 @@ PQgetgroup(PortalBuffer * portal, int tuple_index)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQnfields(PortalBuffer * portal, int tuple_index)
|
PQnfields(PortalBuffer *portal, int tuple_index)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ PQnfields(PortalBuffer * portal, int tuple_index)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQfnumber(PortalBuffer * portal, int tuple_index, char *field_name)
|
PQfnumber(PortalBuffer *portal, int tuple_index, char *field_name)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ PQfnumber(PortalBuffer * portal, int tuple_index, char *field_name)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
PQfname(PortalBuffer * portal, int tuple_index, int field_number)
|
PQfname(PortalBuffer *portal, int tuple_index, int field_number)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -473,7 +473,7 @@ PQfname(PortalBuffer * portal, int tuple_index, int field_number)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQftype(PortalBuffer * portal, int tuple_index, int field_number)
|
PQftype(PortalBuffer *portal, int tuple_index, int field_number)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ PQftype(PortalBuffer * portal, int tuple_index, int field_number)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQfsize(PortalBuffer * portal, int tuple_index, int field_number)
|
PQfsize(PortalBuffer *portal, int tuple_index, int field_number)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp;
|
GroupBuffer *gbp;
|
||||||
|
|
||||||
@ -516,7 +516,7 @@ PQfsize(PortalBuffer * portal, int tuple_index, int field_number)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQsametype(PortalBuffer * portal, int tuple_index1, int tuple_index2)
|
PQsametype(PortalBuffer *portal, int tuple_index1, int tuple_index2)
|
||||||
{
|
{
|
||||||
GroupBuffer *gbp1,
|
GroupBuffer *gbp1,
|
||||||
*gbp2;
|
*gbp2;
|
||||||
@ -536,7 +536,7 @@ PQsametype(PortalBuffer * portal, int tuple_index1, int tuple_index2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static TupleBlock *
|
static TupleBlock *
|
||||||
PQGetTupleBlock(PortalBuffer * portal,
|
PQGetTupleBlock(PortalBuffer *portal,
|
||||||
int tuple_index,
|
int tuple_index,
|
||||||
int *tuple_offset)
|
int *tuple_offset)
|
||||||
{
|
{
|
||||||
@ -579,7 +579,7 @@ PQGetTupleBlock(PortalBuffer * portal,
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
PQgetvalue(PortalBuffer * portal,
|
PQgetvalue(PortalBuffer *portal,
|
||||||
int tuple_index,
|
int tuple_index,
|
||||||
int field_number)
|
int field_number)
|
||||||
{
|
{
|
||||||
@ -599,7 +599,7 @@ PQgetvalue(PortalBuffer * portal,
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
PQgetAttr(PortalBuffer * portal,
|
PQgetAttr(PortalBuffer *portal,
|
||||||
int tuple_index,
|
int tuple_index,
|
||||||
int field_number)
|
int field_number)
|
||||||
{
|
{
|
||||||
@ -627,7 +627,7 @@ PQgetAttr(PortalBuffer * portal,
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PQgetlength(PortalBuffer * portal,
|
PQgetlength(PortalBuffer *portal,
|
||||||
int tuple_index,
|
int tuple_index,
|
||||||
int field_number)
|
int field_number)
|
||||||
{
|
{
|
||||||
@ -716,7 +716,7 @@ PQnotifies()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PQremoveNotify(PQNotifyList * nPtr)
|
PQremoveNotify(PQNotifyList *nPtr)
|
||||||
{
|
{
|
||||||
nPtr->valid = 0; /* remove later */
|
nPtr->valid = 0; /* remove later */
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.6 1997/09/08 02:23:15 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.7 1997/09/08 21:43:48 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -160,7 +160,7 @@ pbuf_addPortal()
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
GroupBuffer *
|
GroupBuffer *
|
||||||
pbuf_addGroup(PortalBuffer * portal)
|
pbuf_addGroup(PortalBuffer *portal)
|
||||||
{
|
{
|
||||||
GroupBuffer *group,
|
GroupBuffer *group,
|
||||||
*group1;
|
*group1;
|
||||||
@ -285,7 +285,7 @@ pbuf_freeEntry(int i)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pbuf_freeTypes(TypeBlock * types)
|
pbuf_freeTypes(TypeBlock *types)
|
||||||
{
|
{
|
||||||
pbuf_free((caddr_t) types);
|
pbuf_free((caddr_t) types);
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ pbuf_freeTypes(TypeBlock * types)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pbuf_freeTuples(TupleBlock * tuples,
|
pbuf_freeTuples(TupleBlock *tuples,
|
||||||
int no_tuples,
|
int no_tuples,
|
||||||
int no_fields)
|
int no_fields)
|
||||||
{
|
{
|
||||||
@ -328,7 +328,7 @@ pbuf_freeTuples(TupleBlock * tuples,
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pbuf_freeGroup(GroupBuffer * group)
|
pbuf_freeGroup(GroupBuffer *group)
|
||||||
{
|
{
|
||||||
if (group->next != NULL)
|
if (group->next != NULL)
|
||||||
pbuf_freeGroup(group->next);
|
pbuf_freeGroup(group->next);
|
||||||
@ -347,7 +347,7 @@ pbuf_freeGroup(GroupBuffer * group)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pbuf_freePortal(PortalBuffer * portal)
|
pbuf_freePortal(PortalBuffer *portal)
|
||||||
{
|
{
|
||||||
if (portal->groups != NULL)
|
if (portal->groups != NULL)
|
||||||
pbuf_freeGroup(portal->groups);
|
pbuf_freeGroup(portal->groups);
|
||||||
@ -381,7 +381,7 @@ pbuf_getIndex(char *pname)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pbuf_setportalinfo(PortalEntry * entry, char *pname)
|
pbuf_setportalinfo(PortalEntry *entry, char *pname)
|
||||||
{
|
{
|
||||||
if (entry)
|
if (entry)
|
||||||
strNcpy(entry->name, pname, PortalNameLength - 1);
|
strNcpy(entry->name, pname, PortalNameLength - 1);
|
||||||
@ -449,7 +449,7 @@ pbuf_close(char *pname)
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
GroupBuffer *
|
GroupBuffer *
|
||||||
pbuf_findGroup(PortalBuffer * portal,
|
pbuf_findGroup(PortalBuffer *portal,
|
||||||
int group_index)
|
int group_index)
|
||||||
{
|
{
|
||||||
GroupBuffer *group;
|
GroupBuffer *group;
|
||||||
@ -473,7 +473,7 @@ pbuf_findGroup(PortalBuffer * portal,
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
pbuf_findFnumber(GroupBuffer * group,
|
pbuf_findFnumber(GroupBuffer *group,
|
||||||
char *field_name)
|
char *field_name)
|
||||||
{
|
{
|
||||||
TypeBlock *types;
|
TypeBlock *types;
|
||||||
@ -498,7 +498,7 @@ pbuf_findFnumber(GroupBuffer * group,
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pbuf_checkFnumber(GroupBuffer * group,
|
pbuf_checkFnumber(GroupBuffer *group,
|
||||||
int field_number)
|
int field_number)
|
||||||
{
|
{
|
||||||
if (field_number < 0 || field_number >= group->no_fields)
|
if (field_number < 0 || field_number >= group->no_fields)
|
||||||
@ -511,7 +511,7 @@ pbuf_checkFnumber(GroupBuffer * group,
|
|||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
pbuf_findFname(GroupBuffer * group,
|
pbuf_findFname(GroupBuffer *group,
|
||||||
int field_number)
|
int field_number)
|
||||||
{
|
{
|
||||||
pbuf_checkFnumber(group, field_number);
|
pbuf_checkFnumber(group, field_number);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.21 1997/09/08 02:23:16 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.22 1997/09/08 21:43:49 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -100,7 +100,7 @@ pq_init(int fd)
|
|||||||
* used for debugging libpq
|
* used for debugging libpq
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
pq_getc(FILE * fin)
|
pq_getc(FILE *fin)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
@ -643,7 +643,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
|
|||||||
* RETURNS: STATUS_OK or STATUS_ERROR
|
* RETURNS: STATUS_OK or STATUS_ERROR
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
StreamConnection(int server_fd, Port * port)
|
StreamConnection(int server_fd, Port *port)
|
||||||
{
|
{
|
||||||
int addrlen;
|
int addrlen;
|
||||||
|
|
||||||
@ -712,7 +712,7 @@ StreamClose(int sock)
|
|||||||
* ---------------------------
|
* ---------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
StreamOpen(char *hostName, short portName, Port * port)
|
StreamOpen(char *hostName, short portName, Port *port)
|
||||||
{
|
{
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
int laddrlen = sizeof(struct sockaddr_in);
|
int laddrlen = sizeof(struct sockaddr_in);
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqPutShort(int integer, FILE * f)
|
pqPutShort(int integer, FILE *f)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
u_short n,
|
u_short n,
|
||||||
@ -62,7 +62,7 @@ pqPutShort(int integer, FILE * f)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqPutLong(int integer, FILE * f)
|
pqPutLong(int integer, FILE *f)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
u_long n;
|
u_long n;
|
||||||
@ -76,7 +76,7 @@ pqPutLong(int integer, FILE * f)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqGetShort(int *result, FILE * f)
|
pqGetShort(int *result, FILE *f)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
u_short n;
|
u_short n;
|
||||||
@ -90,7 +90,7 @@ pqGetShort(int *result, FILE * f)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqGetLong(int *result, FILE * f)
|
pqGetLong(int *result, FILE *f)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
u_long n;
|
u_long n;
|
||||||
@ -107,7 +107,7 @@ pqGetLong(int *result, FILE * f)
|
|||||||
Return 0 if ok.
|
Return 0 if ok.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
pqGetNBytes(char *s, size_t len, FILE * f)
|
pqGetNBytes(char *s, size_t len, FILE *f)
|
||||||
{
|
{
|
||||||
int cnt;
|
int cnt;
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ pqGetNBytes(char *s, size_t len, FILE * f)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqPutNBytes(const char *s, size_t len, FILE * f)
|
pqPutNBytes(const char *s, size_t len, FILE *f)
|
||||||
{
|
{
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@ -136,7 +136,7 @@ pqPutNBytes(const char *s, size_t len, FILE * f)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqGetString(char *s, size_t len, FILE * f)
|
pqGetString(char *s, size_t len, FILE *f)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ pqGetString(char *s, size_t len, FILE * f)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqPutString(const char *s, FILE * f)
|
pqPutString(const char *s, FILE *f)
|
||||||
{
|
{
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
@ -170,14 +170,14 @@ pqPutString(const char *s, FILE * f)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqGetByte(FILE * f)
|
pqGetByte(FILE *f)
|
||||||
{
|
{
|
||||||
return getc(f);
|
return getc(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int
|
int
|
||||||
pqPutByte(int c, FILE * f)
|
pqPutByte(int c, FILE *f)
|
||||||
{
|
{
|
||||||
if (!f)
|
if (!f)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.7 1997/09/08 02:23:18 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.8 1997/09/08 21:43:52 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -57,8 +57,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PacketReceive(Port * port, /* receive port */
|
PacketReceive(Port *port, /* receive port */
|
||||||
PacketBuf * buf, /* MAX_PACKET_SIZE-worth of buffer space */
|
PacketBuf *buf, /* MAX_PACKET_SIZE-worth of buffer space */
|
||||||
bool nonBlocking) /* NON_BLOCKING or BLOCKING i/o */
|
bool nonBlocking) /* NON_BLOCKING or BLOCKING i/o */
|
||||||
{
|
{
|
||||||
PacketLen max_size = sizeof(PacketBuf);
|
PacketLen max_size = sizeof(PacketBuf);
|
||||||
@ -219,8 +219,8 @@ PacketReceive(Port * port, /* receive port */
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PacketSend(Port * port,
|
PacketSend(Port *port,
|
||||||
PacketBuf * buf,
|
PacketBuf *buf,
|
||||||
PacketLen len,
|
PacketLen len,
|
||||||
bool nonBlocking)
|
bool nonBlocking)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.9 1997/09/08 20:55:50 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.10 1997/09/08 21:43:57 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -37,7 +37,7 @@
|
|||||||
* its contents. (good for list of pointers as well as list of integers).
|
* its contents. (good for list of pointers as well as list of integers).
|
||||||
*/
|
*/
|
||||||
List *
|
List *
|
||||||
listCopy(List * list)
|
listCopy(List *list)
|
||||||
{
|
{
|
||||||
List *newlist = NIL;
|
List *newlist = NIL;
|
||||||
List *l,
|
List *l,
|
||||||
@ -78,7 +78,7 @@ listCopy(List * list)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CopyPlanFields(Plan * from, Plan * newnode)
|
CopyPlanFields(Plan *from, Plan *newnode)
|
||||||
{
|
{
|
||||||
newnode->cost = from->cost;
|
newnode->cost = from->cost;
|
||||||
newnode->plan_size = from->plan_size;
|
newnode->plan_size = from->plan_size;
|
||||||
@ -95,7 +95,7 @@ CopyPlanFields(Plan * from, Plan * newnode)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Plan *
|
static Plan *
|
||||||
_copyPlan(Plan * from)
|
_copyPlan(Plan *from)
|
||||||
{
|
{
|
||||||
Plan *newnode = makeNode(Plan);
|
Plan *newnode = makeNode(Plan);
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ _copyPlan(Plan * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Existential *
|
static Existential *
|
||||||
_copyExistential(Existential * from)
|
_copyExistential(Existential *from)
|
||||||
{
|
{
|
||||||
Existential *newnode = makeNode(Existential);
|
Existential *newnode = makeNode(Existential);
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ _copyExistential(Existential * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Result *
|
static Result *
|
||||||
_copyResult(Result * from)
|
_copyResult(Result *from)
|
||||||
{
|
{
|
||||||
Result *newnode = makeNode(Result);
|
Result *newnode = makeNode(Result);
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ _copyAppend(Append *from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CopyScanFields(Scan * from, Scan * newnode)
|
CopyScanFields(Scan *from, Scan *newnode)
|
||||||
{
|
{
|
||||||
newnode->scanrelid = from->scanrelid;
|
newnode->scanrelid = from->scanrelid;
|
||||||
Node_Copy(from, newnode, scanstate);
|
Node_Copy(from, newnode, scanstate);
|
||||||
@ -200,7 +200,7 @@ CopyScanFields(Scan * from, Scan * newnode)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Scan *
|
static Scan *
|
||||||
_copyScan(Scan * from)
|
_copyScan(Scan *from)
|
||||||
{
|
{
|
||||||
Scan *newnode = makeNode(Scan);
|
Scan *newnode = makeNode(Scan);
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ _copyScan(Scan * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static SeqScan *
|
static SeqScan *
|
||||||
_copySeqScan(SeqScan * from)
|
_copySeqScan(SeqScan *from)
|
||||||
{
|
{
|
||||||
SeqScan *newnode = makeNode(SeqScan);
|
SeqScan *newnode = makeNode(SeqScan);
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ _copySeqScan(SeqScan * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static IndexScan *
|
static IndexScan *
|
||||||
_copyIndexScan(IndexScan * from)
|
_copyIndexScan(IndexScan *from)
|
||||||
{
|
{
|
||||||
IndexScan *newnode = makeNode(IndexScan);
|
IndexScan *newnode = makeNode(IndexScan);
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ _copyIndexScan(IndexScan * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CopyJoinFields(Join * from, Join * newnode)
|
CopyJoinFields(Join *from, Join *newnode)
|
||||||
{
|
{
|
||||||
/* nothing extra */
|
/* nothing extra */
|
||||||
return;
|
return;
|
||||||
@ -280,7 +280,7 @@ CopyJoinFields(Join * from, Join * newnode)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Join *
|
static Join *
|
||||||
_copyJoin(Join * from)
|
_copyJoin(Join *from)
|
||||||
{
|
{
|
||||||
Join *newnode = makeNode(Join);
|
Join *newnode = makeNode(Join);
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ _copyJoin(Join * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static NestLoop *
|
static NestLoop *
|
||||||
_copyNestLoop(NestLoop * from)
|
_copyNestLoop(NestLoop *from)
|
||||||
{
|
{
|
||||||
NestLoop *newnode = makeNode(NestLoop);
|
NestLoop *newnode = makeNode(NestLoop);
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ _copyNestLoop(NestLoop * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static MergeJoin *
|
static MergeJoin *
|
||||||
_copyMergeJoin(MergeJoin * from)
|
_copyMergeJoin(MergeJoin *from)
|
||||||
{
|
{
|
||||||
MergeJoin *newnode = makeNode(MergeJoin);
|
MergeJoin *newnode = makeNode(MergeJoin);
|
||||||
List *newlist;
|
List *newlist;
|
||||||
@ -365,7 +365,7 @@ _copyMergeJoin(MergeJoin * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static HashJoin *
|
static HashJoin *
|
||||||
_copyHashJoin(HashJoin * from)
|
_copyHashJoin(HashJoin *from)
|
||||||
{
|
{
|
||||||
HashJoin *newnode = makeNode(HashJoin);
|
HashJoin *newnode = makeNode(HashJoin);
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ _copyHashJoin(HashJoin * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CopyTempFields(Temp * from, Temp * newnode)
|
CopyTempFields(Temp *from, Temp *newnode)
|
||||||
{
|
{
|
||||||
newnode->tempid = from->tempid;
|
newnode->tempid = from->tempid;
|
||||||
newnode->keycount = from->keycount;
|
newnode->keycount = from->keycount;
|
||||||
@ -416,7 +416,7 @@ CopyTempFields(Temp * from, Temp * newnode)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Temp *
|
static Temp *
|
||||||
_copyTemp(Temp * from)
|
_copyTemp(Temp *from)
|
||||||
{
|
{
|
||||||
Temp *newnode = makeNode(Temp);
|
Temp *newnode = makeNode(Temp);
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ _copyTemp(Temp * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Material *
|
static Material *
|
||||||
_copyMaterial(Material * from)
|
_copyMaterial(Material *from)
|
||||||
{
|
{
|
||||||
Material *newnode = makeNode(Material);
|
Material *newnode = makeNode(Material);
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ _copyMaterial(Material * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Sort *
|
static Sort *
|
||||||
_copySort(Sort * from)
|
_copySort(Sort *from)
|
||||||
{
|
{
|
||||||
Sort *newnode = makeNode(Sort);
|
Sort *newnode = makeNode(Sort);
|
||||||
|
|
||||||
@ -512,7 +512,7 @@ _copyAgg(Agg *from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Unique *
|
static Unique *
|
||||||
_copyUnique(Unique * from)
|
_copyUnique(Unique *from)
|
||||||
{
|
{
|
||||||
Unique *newnode = makeNode(Unique);
|
Unique *newnode = makeNode(Unique);
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ _copyUnique(Unique * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Hash *
|
static Hash *
|
||||||
_copyHash(Hash * from)
|
_copyHash(Hash *from)
|
||||||
{
|
{
|
||||||
Hash *newnode = makeNode(Hash);
|
Hash *newnode = makeNode(Hash);
|
||||||
|
|
||||||
@ -572,7 +572,7 @@ _copyHash(Hash * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Resdom *
|
static Resdom *
|
||||||
_copyResdom(Resdom * from)
|
_copyResdom(Resdom *from)
|
||||||
{
|
{
|
||||||
Resdom *newnode = makeNode(Resdom);
|
Resdom *newnode = makeNode(Resdom);
|
||||||
|
|
||||||
@ -596,7 +596,7 @@ _copyResdom(Resdom * from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Fjoin *
|
static Fjoin *
|
||||||
_copyFjoin(Fjoin * from)
|
_copyFjoin(Fjoin *from)
|
||||||
{
|
{
|
||||||
Fjoin *newnode = makeNode(Fjoin);
|
Fjoin *newnode = makeNode(Fjoin);
|
||||||
|
|
||||||
@ -633,7 +633,7 @@ _copyFjoin(Fjoin * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Expr *
|
static Expr *
|
||||||
_copyExpr(Expr * from)
|
_copyExpr(Expr *from)
|
||||||
{
|
{
|
||||||
Expr *newnode = makeNode(Expr);
|
Expr *newnode = makeNode(Expr);
|
||||||
|
|
||||||
@ -655,7 +655,7 @@ _copyExpr(Expr * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Var *
|
static Var *
|
||||||
_copyVar(Var * from)
|
_copyVar(Var *from)
|
||||||
{
|
{
|
||||||
Var *newnode = makeNode(Var);
|
Var *newnode = makeNode(Var);
|
||||||
|
|
||||||
@ -678,7 +678,7 @@ _copyVar(Var * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Oper *
|
static Oper *
|
||||||
_copyOper(Oper * from)
|
_copyOper(Oper *from)
|
||||||
{
|
{
|
||||||
Oper *newnode = makeNode(Oper);
|
Oper *newnode = makeNode(Oper);
|
||||||
|
|
||||||
@ -706,7 +706,7 @@ _copyOper(Oper * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Const *
|
static Const *
|
||||||
_copyConst(Const * from)
|
_copyConst(Const *from)
|
||||||
{
|
{
|
||||||
static Oid cached_type;
|
static Oid cached_type;
|
||||||
static bool cached_typbyval;
|
static bool cached_typbyval;
|
||||||
@ -817,7 +817,7 @@ _copyConst(Const * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Param *
|
static Param *
|
||||||
_copyParam(Param * from)
|
_copyParam(Param *from)
|
||||||
{
|
{
|
||||||
Param *newnode = makeNode(Param);
|
Param *newnode = makeNode(Param);
|
||||||
|
|
||||||
@ -846,7 +846,7 @@ _copyParam(Param * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Func *
|
static Func *
|
||||||
_copyFunc(Func * from)
|
_copyFunc(Func *from)
|
||||||
{
|
{
|
||||||
Func *newnode = makeNode(Func);
|
Func *newnode = makeNode(Func);
|
||||||
|
|
||||||
@ -946,7 +946,7 @@ _copyArrayRef(ArrayRef *from)
|
|||||||
** -- JMH, 8/2/93
|
** -- JMH, 8/2/93
|
||||||
*/
|
*/
|
||||||
static Rel *
|
static Rel *
|
||||||
_copyRel(Rel * from)
|
_copyRel(Rel *from)
|
||||||
{
|
{
|
||||||
Rel *newnode = makeNode(Rel);
|
Rel *newnode = makeNode(Rel);
|
||||||
int i,
|
int i,
|
||||||
@ -1024,7 +1024,7 @@ _copyRel(Rel * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CopyPathFields(Path * from, Path * newnode)
|
CopyPathFields(Path *from, Path *newnode)
|
||||||
{
|
{
|
||||||
newnode->pathtype = from->pathtype;
|
newnode->pathtype = from->pathtype;
|
||||||
|
|
||||||
@ -1079,7 +1079,7 @@ CopyPathFields(Path * from, Path * newnode)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static Path *
|
static Path *
|
||||||
_copyPath(Path * from)
|
_copyPath(Path *from)
|
||||||
{
|
{
|
||||||
Path *newnode = makeNode(Path);
|
Path *newnode = makeNode(Path);
|
||||||
|
|
||||||
@ -1093,7 +1093,7 @@ _copyPath(Path * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static IndexPath *
|
static IndexPath *
|
||||||
_copyIndexPath(IndexPath * from)
|
_copyIndexPath(IndexPath *from)
|
||||||
{
|
{
|
||||||
IndexPath *newnode = makeNode(IndexPath);
|
IndexPath *newnode = makeNode(IndexPath);
|
||||||
|
|
||||||
@ -1136,7 +1136,7 @@ _copyIndexPath(IndexPath * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CopyJoinPathFields(JoinPath * from, JoinPath * newnode)
|
CopyJoinPathFields(JoinPath *from, JoinPath *newnode)
|
||||||
{
|
{
|
||||||
Node_Copy(from, newnode, pathclauseinfo);
|
Node_Copy(from, newnode, pathclauseinfo);
|
||||||
Node_Copy(from, newnode, outerjoinpath);
|
Node_Copy(from, newnode, outerjoinpath);
|
||||||
@ -1148,7 +1148,7 @@ CopyJoinPathFields(JoinPath * from, JoinPath * newnode)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static JoinPath *
|
static JoinPath *
|
||||||
_copyJoinPath(JoinPath * from)
|
_copyJoinPath(JoinPath *from)
|
||||||
{
|
{
|
||||||
JoinPath *newnode = makeNode(JoinPath);
|
JoinPath *newnode = makeNode(JoinPath);
|
||||||
|
|
||||||
@ -1167,7 +1167,7 @@ _copyJoinPath(JoinPath * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static MergePath *
|
static MergePath *
|
||||||
_copyMergePath(MergePath * from)
|
_copyMergePath(MergePath *from)
|
||||||
{
|
{
|
||||||
MergePath *newnode = makeNode(MergePath);
|
MergePath *newnode = makeNode(MergePath);
|
||||||
|
|
||||||
@ -1194,7 +1194,7 @@ _copyMergePath(MergePath * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static HashPath *
|
static HashPath *
|
||||||
_copyHashPath(HashPath * from)
|
_copyHashPath(HashPath *from)
|
||||||
{
|
{
|
||||||
HashPath *newnode = makeNode(HashPath);
|
HashPath *newnode = makeNode(HashPath);
|
||||||
|
|
||||||
@ -1221,7 +1221,7 @@ _copyHashPath(HashPath * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static OrderKey *
|
static OrderKey *
|
||||||
_copyOrderKey(OrderKey * from)
|
_copyOrderKey(OrderKey *from)
|
||||||
{
|
{
|
||||||
OrderKey *newnode = makeNode(OrderKey);
|
OrderKey *newnode = makeNode(OrderKey);
|
||||||
|
|
||||||
@ -1241,7 +1241,7 @@ _copyOrderKey(OrderKey * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static JoinKey *
|
static JoinKey *
|
||||||
_copyJoinKey(JoinKey * from)
|
_copyJoinKey(JoinKey *from)
|
||||||
{
|
{
|
||||||
JoinKey *newnode = makeNode(JoinKey);
|
JoinKey *newnode = makeNode(JoinKey);
|
||||||
|
|
||||||
@ -1260,7 +1260,7 @@ _copyJoinKey(JoinKey * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static MergeOrder *
|
static MergeOrder *
|
||||||
_copyMergeOrder(MergeOrder * from)
|
_copyMergeOrder(MergeOrder *from)
|
||||||
{
|
{
|
||||||
MergeOrder *newnode = makeNode(MergeOrder);
|
MergeOrder *newnode = makeNode(MergeOrder);
|
||||||
|
|
||||||
@ -1282,7 +1282,7 @@ _copyMergeOrder(MergeOrder * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static CInfo *
|
static CInfo *
|
||||||
_copyCInfo(CInfo * from)
|
_copyCInfo(CInfo *from)
|
||||||
{
|
{
|
||||||
CInfo *newnode = makeNode(CInfo);
|
CInfo *newnode = makeNode(CInfo);
|
||||||
|
|
||||||
@ -1311,7 +1311,7 @@ _copyCInfo(CInfo * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CopyJoinMethodFields(JoinMethod * from, JoinMethod * newnode)
|
CopyJoinMethodFields(JoinMethod *from, JoinMethod *newnode)
|
||||||
{
|
{
|
||||||
Node_Copy(from, newnode, jmkeys);
|
Node_Copy(from, newnode, jmkeys);
|
||||||
Node_Copy(from, newnode, clauses);
|
Node_Copy(from, newnode, clauses);
|
||||||
@ -1323,7 +1323,7 @@ CopyJoinMethodFields(JoinMethod * from, JoinMethod * newnode)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static JoinMethod *
|
static JoinMethod *
|
||||||
_copyJoinMethod(JoinMethod * from)
|
_copyJoinMethod(JoinMethod *from)
|
||||||
{
|
{
|
||||||
JoinMethod *newnode = makeNode(JoinMethod);
|
JoinMethod *newnode = makeNode(JoinMethod);
|
||||||
|
|
||||||
@ -1337,7 +1337,7 @@ _copyJoinMethod(JoinMethod * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static HInfo *
|
static HInfo *
|
||||||
_copyHInfo(HInfo * from)
|
_copyHInfo(HInfo *from)
|
||||||
{
|
{
|
||||||
HInfo *newnode = makeNode(HInfo);
|
HInfo *newnode = makeNode(HInfo);
|
||||||
|
|
||||||
@ -1355,7 +1355,7 @@ _copyHInfo(HInfo * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static MInfo *
|
static MInfo *
|
||||||
_copyMInfo(MInfo * from)
|
_copyMInfo(MInfo *from)
|
||||||
{
|
{
|
||||||
MInfo *newnode = makeNode(MInfo);
|
MInfo *newnode = makeNode(MInfo);
|
||||||
|
|
||||||
@ -1373,7 +1373,7 @@ _copyMInfo(MInfo * from)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static JInfo *
|
static JInfo *
|
||||||
_copyJInfo(JInfo * from)
|
_copyJInfo(JInfo *from)
|
||||||
{
|
{
|
||||||
JInfo *newnode = makeNode(JInfo);
|
JInfo *newnode = makeNode(JInfo);
|
||||||
|
|
||||||
@ -1392,7 +1392,7 @@ _copyJInfo(JInfo * from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Iter *
|
static Iter *
|
||||||
_copyIter(Iter * from)
|
_copyIter(Iter *from)
|
||||||
{
|
{
|
||||||
Iter *newnode = makeNode(Iter);
|
Iter *newnode = makeNode(Iter);
|
||||||
|
|
||||||
@ -1403,7 +1403,7 @@ _copyIter(Iter * from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Stream *
|
static Stream *
|
||||||
_copyStream(Stream * from)
|
_copyStream(Stream *from)
|
||||||
{
|
{
|
||||||
Stream *newnode = makeNode(Stream);
|
Stream *newnode = makeNode(Stream);
|
||||||
|
|
||||||
@ -1428,7 +1428,7 @@ _copyStream(Stream * from)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static TargetEntry *
|
static TargetEntry *
|
||||||
_copyTargetEntry(TargetEntry * from)
|
_copyTargetEntry(TargetEntry *from)
|
||||||
{
|
{
|
||||||
TargetEntry *newnode = makeNode(TargetEntry);
|
TargetEntry *newnode = makeNode(TargetEntry);
|
||||||
|
|
||||||
@ -1439,7 +1439,7 @@ _copyTargetEntry(TargetEntry * from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static RangeTblEntry *
|
static RangeTblEntry *
|
||||||
_copyRangeTblEntry(RangeTblEntry * from)
|
_copyRangeTblEntry(RangeTblEntry *from)
|
||||||
{
|
{
|
||||||
RangeTblEntry *newnode = makeNode(RangeTblEntry);
|
RangeTblEntry *newnode = makeNode(RangeTblEntry);
|
||||||
|
|
||||||
@ -1468,7 +1468,7 @@ _copyRangeTblEntry(RangeTblEntry * from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static SortClause *
|
static SortClause *
|
||||||
_copySortClause(SortClause * from)
|
_copySortClause(SortClause *from)
|
||||||
{
|
{
|
||||||
SortClause *newnode = makeNode(SortClause);
|
SortClause *newnode = makeNode(SortClause);
|
||||||
|
|
||||||
@ -1490,7 +1490,7 @@ _copyAConst(A_Const *from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static TypeName *
|
static TypeName *
|
||||||
_copyTypeName(TypeName * from)
|
_copyTypeName(TypeName *from)
|
||||||
{
|
{
|
||||||
TypeName *newnode = makeNode(TypeName);
|
TypeName *newnode = makeNode(TypeName);
|
||||||
|
|
||||||
@ -1510,7 +1510,7 @@ _copyTypeName(TypeName * from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Query *
|
static Query *
|
||||||
_copyQuery(Query * from)
|
_copyQuery(Query *from)
|
||||||
{
|
{
|
||||||
Query *newnode = makeNode(Query);
|
Query *newnode = makeNode(Query);
|
||||||
|
|
||||||
@ -1564,7 +1564,7 @@ _copyQuery(Query * from)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static Value *
|
static Value *
|
||||||
_copyValue(Value * from)
|
_copyValue(Value *from)
|
||||||
{
|
{
|
||||||
Value *newnode = makeNode(Value);
|
Value *newnode = makeNode(Value);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.9 1997/09/08 20:55:52 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.10 1997/09/08 21:44:02 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -26,7 +26,7 @@
|
|||||||
#include "utils/elog.h"
|
#include "utils/elog.h"
|
||||||
#include "storage/itemptr.h"
|
#include "storage/itemptr.h"
|
||||||
|
|
||||||
static bool equali(List * a, List * b);
|
static bool equali(List *a, List *b);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stuff from primnodes.h
|
* Stuff from primnodes.h
|
||||||
@ -36,7 +36,7 @@ static bool equali(List * a, List * b);
|
|||||||
* Resdom is a subclass of Node.
|
* Resdom is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalResdom(Resdom * a, Resdom * b)
|
_equalResdom(Resdom *a, Resdom *b)
|
||||||
{
|
{
|
||||||
if (a->resno != b->resno)
|
if (a->resno != b->resno)
|
||||||
return (false);
|
return (false);
|
||||||
@ -55,7 +55,7 @@ _equalResdom(Resdom * a, Resdom * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalFjoin(Fjoin * a, Fjoin * b)
|
_equalFjoin(Fjoin *a, Fjoin *b)
|
||||||
{
|
{
|
||||||
int nNodes;
|
int nNodes;
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ _equalFjoin(Fjoin * a, Fjoin * b)
|
|||||||
* Expr is a subclass of Node.
|
* Expr is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalExpr(Expr * a, Expr * b)
|
_equalExpr(Expr *a, Expr *b)
|
||||||
{
|
{
|
||||||
if (a->opType != b->opType)
|
if (a->opType != b->opType)
|
||||||
return (false);
|
return (false);
|
||||||
@ -92,13 +92,13 @@ _equalExpr(Expr * a, Expr * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalIter(Iter * a, Iter * b)
|
_equalIter(Iter *a, Iter *b)
|
||||||
{
|
{
|
||||||
return (equal(a->iterexpr, b->iterexpr));
|
return (equal(a->iterexpr, b->iterexpr));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalStream(Stream * a, Stream * b)
|
_equalStream(Stream *a, Stream *b)
|
||||||
{
|
{
|
||||||
if (a->clausetype != b->clausetype)
|
if (a->clausetype != b->clausetype)
|
||||||
return (false);
|
return (false);
|
||||||
@ -121,7 +121,7 @@ _equalStream(Stream * a, Stream * b)
|
|||||||
* Var is a subclass of Expr.
|
* Var is a subclass of Expr.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalVar(Var * a, Var * b)
|
_equalVar(Var *a, Var *b)
|
||||||
{
|
{
|
||||||
if (a->varno != b->varno)
|
if (a->varno != b->varno)
|
||||||
return (false);
|
return (false);
|
||||||
@ -177,7 +177,7 @@ _equalArrayRef(ArrayRef *a, ArrayRef *b)
|
|||||||
* Oper is a subclass of Expr.
|
* Oper is a subclass of Expr.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalOper(Oper * a, Oper * b)
|
_equalOper(Oper *a, Oper *b)
|
||||||
{
|
{
|
||||||
if (a->opno != b->opno)
|
if (a->opno != b->opno)
|
||||||
return (false);
|
return (false);
|
||||||
@ -191,7 +191,7 @@ _equalOper(Oper * a, Oper * b)
|
|||||||
* Const is a subclass of Expr.
|
* Const is a subclass of Expr.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalConst(Const * a, Const * b)
|
_equalConst(Const *a, Const *b)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -214,7 +214,7 @@ _equalConst(Const * a, Const * b)
|
|||||||
* Param is a subclass of Expr.
|
* Param is a subclass of Expr.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalParam(Param * a, Param * b)
|
_equalParam(Param *a, Param *b)
|
||||||
{
|
{
|
||||||
if (a->paramkind != b->paramkind)
|
if (a->paramkind != b->paramkind)
|
||||||
return (false);
|
return (false);
|
||||||
@ -254,7 +254,7 @@ _equalParam(Param * a, Param * b)
|
|||||||
* Func is a subclass of Expr.
|
* Func is a subclass of Expr.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalFunc(Func * a, Func * b)
|
_equalFunc(Func *a, Func *b)
|
||||||
{
|
{
|
||||||
if (a->funcid != b->funcid)
|
if (a->funcid != b->funcid)
|
||||||
return (false);
|
return (false);
|
||||||
@ -276,7 +276,7 @@ _equalFunc(Func * a, Func * b)
|
|||||||
* CInfo is a subclass of Node.
|
* CInfo is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalCInfo(CInfo * a, CInfo * b)
|
_equalCInfo(CInfo *a, CInfo *b)
|
||||||
{
|
{
|
||||||
Assert(IsA(a, CInfo));
|
Assert(IsA(a, CInfo));
|
||||||
Assert(IsA(b, CInfo));
|
Assert(IsA(b, CInfo));
|
||||||
@ -298,7 +298,7 @@ _equalCInfo(CInfo * a, CInfo * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalJoinMethod(JoinMethod * a, JoinMethod * b)
|
_equalJoinMethod(JoinMethod *a, JoinMethod *b)
|
||||||
{
|
{
|
||||||
Assert(IsA(a, JoinMethod));
|
Assert(IsA(a, JoinMethod));
|
||||||
Assert(IsA(b, JoinMethod));
|
Assert(IsA(b, JoinMethod));
|
||||||
@ -313,7 +313,7 @@ _equalJoinMethod(JoinMethod * a, JoinMethod * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalPath(Path * a, Path * b)
|
_equalPath(Path *a, Path *b)
|
||||||
{
|
{
|
||||||
if (a->pathtype != b->pathtype)
|
if (a->pathtype != b->pathtype)
|
||||||
return (false);
|
return (false);
|
||||||
@ -368,7 +368,7 @@ _equalPath(Path * a, Path * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalIndexPath(IndexPath * a, IndexPath * b)
|
_equalIndexPath(IndexPath *a, IndexPath *b)
|
||||||
{
|
{
|
||||||
if (!_equalPath((Path *) a, (Path *) b))
|
if (!_equalPath((Path *) a, (Path *) b))
|
||||||
return (false);
|
return (false);
|
||||||
@ -380,7 +380,7 @@ _equalIndexPath(IndexPath * a, IndexPath * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalJoinPath(JoinPath * a, JoinPath * b)
|
_equalJoinPath(JoinPath *a, JoinPath *b)
|
||||||
{
|
{
|
||||||
Assert(IsA_JoinPath(a));
|
Assert(IsA_JoinPath(a));
|
||||||
Assert(IsA_JoinPath(b));
|
Assert(IsA_JoinPath(b));
|
||||||
@ -397,7 +397,7 @@ _equalJoinPath(JoinPath * a, JoinPath * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalMergePath(MergePath * a, MergePath * b)
|
_equalMergePath(MergePath *a, MergePath *b)
|
||||||
{
|
{
|
||||||
Assert(IsA(a, MergePath));
|
Assert(IsA(a, MergePath));
|
||||||
Assert(IsA(b, MergePath));
|
Assert(IsA(b, MergePath));
|
||||||
@ -414,7 +414,7 @@ _equalMergePath(MergePath * a, MergePath * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalHashPath(HashPath * a, HashPath * b)
|
_equalHashPath(HashPath *a, HashPath *b)
|
||||||
{
|
{
|
||||||
Assert(IsA(a, HashPath));
|
Assert(IsA(a, HashPath));
|
||||||
Assert(IsA(b, HashPath));
|
Assert(IsA(b, HashPath));
|
||||||
@ -431,7 +431,7 @@ _equalHashPath(HashPath * a, HashPath * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalJoinKey(JoinKey * a, JoinKey * b)
|
_equalJoinKey(JoinKey *a, JoinKey *b)
|
||||||
{
|
{
|
||||||
Assert(IsA(a, JoinKey));
|
Assert(IsA(a, JoinKey));
|
||||||
Assert(IsA(b, JoinKey));
|
Assert(IsA(b, JoinKey));
|
||||||
@ -444,7 +444,7 @@ _equalJoinKey(JoinKey * a, JoinKey * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalMergeOrder(MergeOrder * a, MergeOrder * b)
|
_equalMergeOrder(MergeOrder *a, MergeOrder *b)
|
||||||
{
|
{
|
||||||
if (a == (MergeOrder *) NULL && b == (MergeOrder *) NULL)
|
if (a == (MergeOrder *) NULL && b == (MergeOrder *) NULL)
|
||||||
return (true);
|
return (true);
|
||||||
@ -465,7 +465,7 @@ _equalMergeOrder(MergeOrder * a, MergeOrder * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalHInfo(HInfo * a, HInfo * b)
|
_equalHInfo(HInfo *a, HInfo *b)
|
||||||
{
|
{
|
||||||
Assert(IsA(a, HInfo));
|
Assert(IsA(a, HInfo));
|
||||||
Assert(IsA(b, HInfo));
|
Assert(IsA(b, HInfo));
|
||||||
@ -479,7 +479,7 @@ _equalHInfo(HInfo * a, HInfo * b)
|
|||||||
* fixed to compare all fields.
|
* fixed to compare all fields.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalIndexScan(IndexScan * a, IndexScan * b)
|
_equalIndexScan(IndexScan *a, IndexScan *b)
|
||||||
{
|
{
|
||||||
Assert(IsA(a, IndexScan));
|
Assert(IsA(a, IndexScan));
|
||||||
Assert(IsA(b, IndexScan));
|
Assert(IsA(b, IndexScan));
|
||||||
@ -500,7 +500,7 @@ _equalIndexScan(IndexScan * a, IndexScan * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalJInfo(JInfo * a, JInfo * b)
|
_equalJInfo(JInfo *a, JInfo *b)
|
||||||
{
|
{
|
||||||
Assert(IsA(a, JInfo));
|
Assert(IsA(a, JInfo));
|
||||||
Assert(IsA(b, JInfo));
|
Assert(IsA(b, JInfo));
|
||||||
@ -523,7 +523,7 @@ _equalJInfo(JInfo * a, JInfo * b)
|
|||||||
* EState is a subclass of Node.
|
* EState is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalEState(EState * a, EState * b)
|
_equalEState(EState *a, EState *b)
|
||||||
{
|
{
|
||||||
if (a->es_direction != b->es_direction)
|
if (a->es_direction != b->es_direction)
|
||||||
return (false);
|
return (false);
|
||||||
@ -538,7 +538,7 @@ _equalEState(EState * a, EState * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalTargetEntry(TargetEntry * a, TargetEntry * b)
|
_equalTargetEntry(TargetEntry *a, TargetEntry *b)
|
||||||
{
|
{
|
||||||
if (!equal(a->resdom, b->resdom))
|
if (!equal(a->resdom, b->resdom))
|
||||||
return (false);
|
return (false);
|
||||||
@ -558,7 +558,7 @@ _equalTargetEntry(TargetEntry * a, TargetEntry * b)
|
|||||||
* to be recursive, but it should run faster if we iterate.
|
* to be recursive, but it should run faster if we iterate.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
_equalValue(Value * a, Value * b)
|
_equalValue(Value *a, Value *b)
|
||||||
{
|
{
|
||||||
if (a->type != b->type)
|
if (a->type != b->type)
|
||||||
return (false);
|
return (false);
|
||||||
@ -722,7 +722,7 @@ equal(void *a, void *b)
|
|||||||
* XXX temp hack. needs something like T_IntList
|
* XXX temp hack. needs something like T_IntList
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
equali(List * a, List * b)
|
equali(List *a, List *b)
|
||||||
{
|
{
|
||||||
List *la = (List *) a;
|
List *la = (List *) a;
|
||||||
List *lb = (List *) b;
|
List *lb = (List *) b;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.6 1997/09/08 02:23:38 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.7 1997/09/08 21:44:04 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
|
||||||
@ -58,7 +58,7 @@ makeList(void *elem,...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
lcons(void *obj, List * list)
|
lcons(void *obj, List *list)
|
||||||
{
|
{
|
||||||
List *l = makeNode(List);
|
List *l = makeNode(List);
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ lcons(void *obj, List * list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
lconsi(int datum, List * list)
|
lconsi(int datum, List *list)
|
||||||
{
|
{
|
||||||
List *l = makeNode(List);
|
List *l = makeNode(List);
|
||||||
|
|
||||||
@ -78,13 +78,13 @@ lconsi(int datum, List * list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
lappend(List * list, void *obj)
|
lappend(List *list, void *obj)
|
||||||
{
|
{
|
||||||
return nconc(list, lcons(obj, NIL));
|
return nconc(list, lcons(obj, NIL));
|
||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
lappendi(List * list, int datum)
|
lappendi(List *list, int datum)
|
||||||
{
|
{
|
||||||
return nconc(list, lconsi(datum, NIL));
|
return nconc(list, lconsi(datum, NIL));
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ makeString(char *str)
|
|||||||
|
|
||||||
/* n starts with 0 */
|
/* n starts with 0 */
|
||||||
void *
|
void *
|
||||||
nth(int n, List * l)
|
nth(int n, List *l)
|
||||||
{
|
{
|
||||||
/* XXX assume list is long enough */
|
/* XXX assume list is long enough */
|
||||||
while (n > 0)
|
while (n > 0)
|
||||||
@ -133,7 +133,7 @@ nth(int n, List * l)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nthi(int n, List * l)
|
nthi(int n, List *l)
|
||||||
{
|
{
|
||||||
/* XXX assume list is long enough */
|
/* XXX assume list is long enough */
|
||||||
while (n > 0)
|
while (n > 0)
|
||||||
@ -146,7 +146,7 @@ nthi(int n, List * l)
|
|||||||
|
|
||||||
/* this is here solely for rt_store. Get rid of me some day! */
|
/* this is here solely for rt_store. Get rid of me some day! */
|
||||||
void
|
void
|
||||||
set_nth(List * l, int n, void *elem)
|
set_nth(List *l, int n, void *elem)
|
||||||
{
|
{
|
||||||
/* XXX assume list is long enough */
|
/* XXX assume list is long enough */
|
||||||
while (n > 0)
|
while (n > 0)
|
||||||
@ -159,7 +159,7 @@ set_nth(List * l, int n, void *elem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
length(List * l)
|
length(List *l)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ length(List * l)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
freeList(List * list)
|
freeList(List *list)
|
||||||
{
|
{
|
||||||
while (list != NIL)
|
while (list != NIL)
|
||||||
{
|
{
|
||||||
@ -187,7 +187,7 @@ freeList(List * list)
|
|||||||
* below are for backwards compatibility
|
* below are for backwards compatibility
|
||||||
*/
|
*/
|
||||||
List *
|
List *
|
||||||
append(List * l1, List * l2)
|
append(List *l1, List *l2)
|
||||||
{
|
{
|
||||||
List *newlist,
|
List *newlist,
|
||||||
*newlist2,
|
*newlist2,
|
||||||
@ -209,7 +209,7 @@ append(List * l1, List * l2)
|
|||||||
* below are for backwards compatibility
|
* below are for backwards compatibility
|
||||||
*/
|
*/
|
||||||
List *
|
List *
|
||||||
intAppend(List * l1, List * l2)
|
intAppend(List *l1, List *l2)
|
||||||
{
|
{
|
||||||
List *newlist,
|
List *newlist,
|
||||||
*newlist2,
|
*newlist2,
|
||||||
@ -228,7 +228,7 @@ intAppend(List * l1, List * l2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
nconc(List * l1, List * l2)
|
nconc(List *l1, List *l2)
|
||||||
{
|
{
|
||||||
List *temp;
|
List *temp;
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ nconc(List * l1, List * l2)
|
|||||||
|
|
||||||
|
|
||||||
List *
|
List *
|
||||||
nreverse(List * list)
|
nreverse(List *list)
|
||||||
{
|
{
|
||||||
List *rlist = NIL;
|
List *rlist = NIL;
|
||||||
List *p = NIL;
|
List *p = NIL;
|
||||||
@ -278,7 +278,7 @@ nreverse(List * list)
|
|||||||
* XXX only good for IntList -ay
|
* XXX only good for IntList -ay
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
same(List * foo, List * bar)
|
same(List *foo, List *bar)
|
||||||
{
|
{
|
||||||
List *temp = NIL;
|
List *temp = NIL;
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ same(List * foo, List * bar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
LispUnion(List * foo, List * bar)
|
LispUnion(List *foo, List *bar)
|
||||||
{
|
{
|
||||||
List *retval = NIL;
|
List *retval = NIL;
|
||||||
List *i = NIL;
|
List *i = NIL;
|
||||||
@ -332,7 +332,7 @@ LispUnion(List * foo, List * bar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
LispUnioni(List * foo, List * bar)
|
LispUnioni(List *foo, List *bar)
|
||||||
{
|
{
|
||||||
List *retval = NIL;
|
List *retval = NIL;
|
||||||
List *i = NIL;
|
List *i = NIL;
|
||||||
@ -369,7 +369,7 @@ LispUnioni(List * foo, List * bar)
|
|||||||
* bar
|
* bar
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
member(void *foo, List * bar)
|
member(void *foo, List *bar)
|
||||||
{
|
{
|
||||||
List *i;
|
List *i;
|
||||||
|
|
||||||
@ -380,7 +380,7 @@ member(void *foo, List * bar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
intMember(int foo, List * bar)
|
intMember(int foo, List *bar)
|
||||||
{
|
{
|
||||||
List *i;
|
List *i;
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ intMember(int foo, List * bar)
|
|||||||
* only does pointer comparisons. Removes 'elem' from the the linked list.
|
* only does pointer comparisons. Removes 'elem' from the the linked list.
|
||||||
*/
|
*/
|
||||||
List *
|
List *
|
||||||
lremove(void *elem, List * list)
|
lremove(void *elem, List *list)
|
||||||
{
|
{
|
||||||
List *l;
|
List *l;
|
||||||
List *prev = NIL;
|
List *prev = NIL;
|
||||||
@ -422,7 +422,7 @@ lremove(void *elem, List * list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
LispRemove(void *elem, List * list)
|
LispRemove(void *elem, List *list)
|
||||||
{
|
{
|
||||||
List *temp = NIL;
|
List *temp = NIL;
|
||||||
List *prev = NIL;
|
List *prev = NIL;
|
||||||
@ -447,7 +447,7 @@ LispRemove(void *elem, List * list)
|
|||||||
|
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
List *
|
List *
|
||||||
intLispRemove(int elem, List * list)
|
intLispRemove(int elem, List *list)
|
||||||
{
|
{
|
||||||
List *temp = NIL;
|
List *temp = NIL;
|
||||||
List *prev = NIL;
|
List *prev = NIL;
|
||||||
@ -473,7 +473,7 @@ intLispRemove(int elem, List * list)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
List *
|
List *
|
||||||
set_difference(List * list1, List * list2)
|
set_difference(List *list1, List *list2)
|
||||||
{
|
{
|
||||||
List *temp1 = NIL;
|
List *temp1 = NIL;
|
||||||
List *result = NIL;
|
List *result = NIL;
|
||||||
@ -490,7 +490,7 @@ set_difference(List * list1, List * list2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
set_differencei(List * list1, List * list2)
|
set_differencei(List *list1, List *list2)
|
||||||
{
|
{
|
||||||
List *temp1 = NIL;
|
List *temp1 = NIL;
|
||||||
List *result = NIL;
|
List *result = NIL;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.5 1997/09/08 02:23:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.6 1997/09/08 21:44:06 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -23,16 +23,16 @@
|
|||||||
#include "nodes/nodeFuncs.h"
|
#include "nodes/nodeFuncs.h"
|
||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
|
|
||||||
static bool var_is_inner(Var * var);
|
static bool var_is_inner(Var *var);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* single_node -
|
* single_node -
|
||||||
* Returns t if node corresponds to a single-noded expression
|
* Returns t if node corresponds to a single-noded expression
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
single_node(Node * node)
|
single_node(Node *node)
|
||||||
{
|
{
|
||||||
if (IsA(node, Ident) || IsA(node, Const) || IsA(node, Var) || IsA(node, Param))
|
if (IsA(node, Ident) ||IsA(node, Const) ||IsA(node, Var) ||IsA(node, Param))
|
||||||
return (true);
|
return (true);
|
||||||
else
|
else
|
||||||
return (false);
|
return (false);
|
||||||
@ -58,22 +58,22 @@ single_node(Node * node)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
var_is_outer(Var * var)
|
var_is_outer(Var *var)
|
||||||
{
|
{
|
||||||
return ((bool) (var->varno == OUTER));
|
return ((bool) (var->varno == OUTER));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
var_is_inner(Var * var)
|
var_is_inner(Var *var)
|
||||||
{
|
{
|
||||||
return ((bool) (var->varno == INNER));
|
return ((bool) (var->varno == INNER));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
var_is_rel(Var * var)
|
var_is_rel(Var *var)
|
||||||
{
|
{
|
||||||
return (bool)
|
return (bool)
|
||||||
! (var_is_inner(var) || var_is_outer(var));
|
!(var_is_inner(var) || var_is_outer(var));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
@ -90,7 +90,7 @@ var_is_rel(Var * var)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Oper *
|
Oper *
|
||||||
replace_opid(Oper * oper)
|
replace_opid(Oper *oper)
|
||||||
{
|
{
|
||||||
oper->opid = get_opcode(oper->opno);
|
oper->opid = get_opcode(oper->opno);
|
||||||
oper->op_fcache = NULL;
|
oper->op_fcache = NULL;
|
||||||
@ -108,10 +108,10 @@ replace_opid(Oper * oper)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
non_null(Expr * c)
|
non_null(Expr *c)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (IsA(c, Const) && !((Const *) c)->constisnull)
|
if (IsA(c, Const) &&!((Const *) c)->constisnull)
|
||||||
return (true);
|
return (true);
|
||||||
else
|
else
|
||||||
return (false);
|
return (false);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.9 1997/09/08 20:55:56 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.10 1997/09/08 21:44: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
|
||||||
@ -53,7 +53,7 @@ static void _outNode(StringInfo str, void *obj);
|
|||||||
* converts a List of integers
|
* converts a List of integers
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outIntList(StringInfo str, List * list)
|
_outIntList(StringInfo str, List *list)
|
||||||
{
|
{
|
||||||
List *l;
|
List *l;
|
||||||
char buf[500];
|
char buf[500];
|
||||||
@ -68,7 +68,7 @@ _outIntList(StringInfo str, List * list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outQuery(StringInfo str, Query * node)
|
_outQuery(StringInfo str, Query *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ _outQuery(StringInfo str, Query * node)
|
|||||||
* print the basic stuff of all nodes that inherit from Plan
|
* print the basic stuff of all nodes that inherit from Plan
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outPlanInfo(StringInfo str, Plan * node)
|
_outPlanInfo(StringInfo str, Plan *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ _outPlanInfo(StringInfo str, Plan * node)
|
|||||||
* Stuff from plannodes.h
|
* Stuff from plannodes.h
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outPlan(StringInfo str, Plan * node)
|
_outPlan(StringInfo str, Plan *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ _outPlan(StringInfo str, Plan * node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outResult(StringInfo str, Result * node)
|
_outResult(StringInfo str, Result *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ _outResult(StringInfo str, Result * node)
|
|||||||
* Existential is a subclass of Plan.
|
* Existential is a subclass of Plan.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outExistential(StringInfo str, Existential * node)
|
_outExistential(StringInfo str, Existential *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ _outAppend(StringInfo str, Append *node)
|
|||||||
* Join is a subclass of Plan
|
* Join is a subclass of Plan
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outJoin(StringInfo str, Join * node)
|
_outJoin(StringInfo str, Join *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ _outJoin(StringInfo str, Join * node)
|
|||||||
* NestLoop is a subclass of Join
|
* NestLoop is a subclass of Join
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outNestLoop(StringInfo str, NestLoop * node)
|
_outNestLoop(StringInfo str, NestLoop *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ _outNestLoop(StringInfo str, NestLoop * node)
|
|||||||
* MergeJoin is a subclass of Join
|
* MergeJoin is a subclass of Join
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outMergeJoin(StringInfo str, MergeJoin * node)
|
_outMergeJoin(StringInfo str, MergeJoin *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ _outMergeJoin(StringInfo str, MergeJoin * node)
|
|||||||
* HashJoin is a subclass of Join.
|
* HashJoin is a subclass of Join.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outHashJoin(StringInfo str, HashJoin * node)
|
_outHashJoin(StringInfo str, HashJoin *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ _outHashJoin(StringInfo str, HashJoin * node)
|
|||||||
* Scan is a subclass of Node
|
* Scan is a subclass of Node
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outScan(StringInfo str, Scan * node)
|
_outScan(StringInfo str, Scan *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ _outScan(StringInfo str, Scan * node)
|
|||||||
* SeqScan is a subclass of Scan
|
* SeqScan is a subclass of Scan
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outSeqScan(StringInfo str, SeqScan * node)
|
_outSeqScan(StringInfo str, SeqScan *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ _outSeqScan(StringInfo str, SeqScan * node)
|
|||||||
* IndexScan is a subclass of Scan
|
* IndexScan is a subclass of Scan
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outIndexScan(StringInfo str, IndexScan * node)
|
_outIndexScan(StringInfo str, IndexScan *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ _outIndexScan(StringInfo str, IndexScan * node)
|
|||||||
* Temp is a subclass of Plan
|
* Temp is a subclass of Plan
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outTemp(StringInfo str, Temp * node)
|
_outTemp(StringInfo str, Temp *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ _outTemp(StringInfo str, Temp * node)
|
|||||||
* Sort is a subclass of Temp
|
* Sort is a subclass of Temp
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outSort(StringInfo str, Sort * node)
|
_outSort(StringInfo str, Sort *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -401,7 +401,7 @@ _outAgg(StringInfo str, Agg *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outGroup(StringInfo str, Group * node)
|
_outGroup(StringInfo str, Group *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -422,7 +422,7 @@ _outGroup(StringInfo str, Group * node)
|
|||||||
* For some reason, unique is a subclass of Temp.
|
* For some reason, unique is a subclass of Temp.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outUnique(StringInfo str, Unique * node)
|
_outUnique(StringInfo str, Unique *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ _outUnique(StringInfo str, Unique * node)
|
|||||||
* Hash is a subclass of Temp
|
* Hash is a subclass of Temp
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outHash(StringInfo str, Hash * node)
|
_outHash(StringInfo str, Hash *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ _outHash(StringInfo str, Hash * node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outTee(StringInfo str, Tee * node)
|
_outTee(StringInfo str, Tee *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -494,7 +494,7 @@ _outTee(StringInfo str, Tee * node)
|
|||||||
* Resdom is a subclass of Node
|
* Resdom is a subclass of Node
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outResdom(StringInfo str, Resdom * node)
|
_outResdom(StringInfo str, Resdom *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -519,7 +519,7 @@ _outResdom(StringInfo str, Resdom * node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outFjoin(StringInfo str, Fjoin * node)
|
_outFjoin(StringInfo str, Fjoin *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
int i;
|
int i;
|
||||||
@ -550,7 +550,7 @@ _outFjoin(StringInfo str, Fjoin * node)
|
|||||||
* Expr is a subclass of Node
|
* Expr is a subclass of Node
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outExpr(StringInfo str, Expr * node)
|
_outExpr(StringInfo str, Expr *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
char *opstr = NULL;
|
char *opstr = NULL;
|
||||||
@ -592,7 +592,7 @@ _outExpr(StringInfo str, Expr * node)
|
|||||||
* Var is a subclass of Expr
|
* Var is a subclass of Expr
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outVar(StringInfo str, Var * node)
|
_outVar(StringInfo str, Var *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -614,7 +614,7 @@ _outVar(StringInfo str, Var * node)
|
|||||||
* Const is a subclass of Expr
|
* Const is a subclass of Expr
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outConst(StringInfo str, Const * node)
|
_outConst(StringInfo str, Const *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -743,7 +743,7 @@ _outArrayRef(StringInfo str, ArrayRef *node)
|
|||||||
* Func is a subclass of Expr
|
* Func is a subclass of Expr
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outFunc(StringInfo str, Func * node)
|
_outFunc(StringInfo str, Func *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -772,7 +772,7 @@ _outFunc(StringInfo str, Func * node)
|
|||||||
* Oper is a subclass of Expr
|
* Oper is a subclass of Expr
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outOper(StringInfo str, Oper * node)
|
_outOper(StringInfo str, Oper *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -791,7 +791,7 @@ _outOper(StringInfo str, Oper * node)
|
|||||||
* Param is a subclass of Expr
|
* Param is a subclass of Expr
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outParam(StringInfo str, Param * node)
|
_outParam(StringInfo str, Param *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -818,7 +818,7 @@ _outParam(StringInfo str, Param * node)
|
|||||||
* EState is a subclass of Node.
|
* EState is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outEState(StringInfo str, EState * node)
|
_outEState(StringInfo str, EState *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -841,7 +841,7 @@ _outEState(StringInfo str, EState * node)
|
|||||||
* Stuff from relation.h
|
* Stuff from relation.h
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outRel(StringInfo str, Rel * node)
|
_outRel(StringInfo str, Rel *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -917,7 +917,7 @@ _outRel(StringInfo str, Rel * node)
|
|||||||
* TargetEntry is a subclass of Node.
|
* TargetEntry is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outTargetEntry(StringInfo str, TargetEntry * node)
|
_outTargetEntry(StringInfo str, TargetEntry *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -940,7 +940,7 @@ _outTargetEntry(StringInfo str, TargetEntry * node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outRangeTblEntry(StringInfo str, RangeTblEntry * node)
|
_outRangeTblEntry(StringInfo str, RangeTblEntry *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -966,7 +966,7 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry * node)
|
|||||||
* Path is a subclass of Node.
|
* Path is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outPath(StringInfo str, Path * node)
|
_outPath(StringInfo str, Path *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -989,7 +989,7 @@ _outPath(StringInfo str, Path * node)
|
|||||||
* IndexPath is a subclass of Path.
|
* IndexPath is a subclass of Path.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outIndexPath(StringInfo str, IndexPath * node)
|
_outIndexPath(StringInfo str, IndexPath *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1030,7 +1030,7 @@ _outIndexPath(StringInfo str, IndexPath * node)
|
|||||||
* JoinPath is a subclass of Path
|
* JoinPath is a subclass of Path
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outJoinPath(StringInfo str, JoinPath * node)
|
_outJoinPath(StringInfo str, JoinPath *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1084,7 +1084,7 @@ _outJoinPath(StringInfo str, JoinPath * node)
|
|||||||
* MergePath is a subclass of JoinPath.
|
* MergePath is a subclass of JoinPath.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outMergePath(StringInfo str, MergePath * node)
|
_outMergePath(StringInfo str, MergePath *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1140,7 +1140,7 @@ _outMergePath(StringInfo str, MergePath * node)
|
|||||||
* HashPath is a subclass of JoinPath.
|
* HashPath is a subclass of JoinPath.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outHashPath(StringInfo str, HashPath * node)
|
_outHashPath(StringInfo str, HashPath *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1196,7 +1196,7 @@ _outHashPath(StringInfo str, HashPath * node)
|
|||||||
* OrderKey is a subclass of Node.
|
* OrderKey is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outOrderKey(StringInfo str, OrderKey * node)
|
_outOrderKey(StringInfo str, OrderKey *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1213,7 +1213,7 @@ _outOrderKey(StringInfo str, OrderKey * node)
|
|||||||
* JoinKey is a subclass of Node.
|
* JoinKey is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outJoinKey(StringInfo str, JoinKey * node)
|
_outJoinKey(StringInfo str, JoinKey *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1234,7 +1234,7 @@ _outJoinKey(StringInfo str, JoinKey * node)
|
|||||||
* MergeOrder is a subclass of Node.
|
* MergeOrder is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outMergeOrder(StringInfo str, MergeOrder * node)
|
_outMergeOrder(StringInfo str, MergeOrder *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1258,7 +1258,7 @@ _outMergeOrder(StringInfo str, MergeOrder * node)
|
|||||||
* CInfo is a subclass of Node.
|
* CInfo is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outCInfo(StringInfo str, CInfo * node)
|
_outCInfo(StringInfo str, CInfo *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1291,7 +1291,7 @@ _outCInfo(StringInfo str, CInfo * node)
|
|||||||
* JoinMethod is a subclass of Node.
|
* JoinMethod is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outJoinMethod(StringInfo str, JoinMethod * node)
|
_outJoinMethod(StringInfo str, JoinMethod *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1313,7 +1313,7 @@ _outJoinMethod(StringInfo str, JoinMethod * node)
|
|||||||
* HInfo is a subclass of JoinMethod.
|
* HInfo is a subclass of JoinMethod.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outHInfo(StringInfo str, HInfo * node)
|
_outHInfo(StringInfo str, HInfo *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1339,7 +1339,7 @@ _outHInfo(StringInfo str, HInfo * node)
|
|||||||
* JInfo is a subclass of Node.
|
* JInfo is a subclass of Node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_outJInfo(StringInfo str, JInfo * node)
|
_outJInfo(StringInfo str, JInfo *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1431,7 +1431,7 @@ _outDatum(StringInfo str, Datum value, Oid type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outIter(StringInfo str, Iter * node)
|
_outIter(StringInfo str, Iter *node)
|
||||||
{
|
{
|
||||||
appendStringInfo(str, "ITER");
|
appendStringInfo(str, "ITER");
|
||||||
|
|
||||||
@ -1440,7 +1440,7 @@ _outIter(StringInfo str, Iter * node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outStream(StringInfo str, Stream * node)
|
_outStream(StringInfo str, Stream *node)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
@ -1472,7 +1472,7 @@ _outStream(StringInfo str, Stream * node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outValue(StringInfo str, Value * value)
|
_outValue(StringInfo str, Value *value)
|
||||||
{
|
{
|
||||||
char buf[500];
|
char buf[500];
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.8 1997/09/08 02:23:42 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.9 1997/09/08 21:44:10 momjian Exp $
|
||||||
*
|
*
|
||||||
* HISTORY
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#include "nodes/plannodes.h"
|
#include "nodes/plannodes.h"
|
||||||
#include "optimizer/clauses.h"
|
#include "optimizer/clauses.h"
|
||||||
|
|
||||||
static char *plannode_type(Plan * p);
|
static char *plannode_type(Plan *p);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print--
|
* print--
|
||||||
@ -135,7 +135,7 @@ pprint(void *obj)
|
|||||||
* print contents of range table
|
* print contents of range table
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_rt(List * rtable)
|
print_rt(List *rtable)
|
||||||
{
|
{
|
||||||
List *l;
|
List *l;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
@ -160,7 +160,7 @@ print_rt(List * rtable)
|
|||||||
* print an expression
|
* print an expression
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_expr(Node * expr, List * rtable)
|
print_expr(Node *expr, List *rtable)
|
||||||
{
|
{
|
||||||
if (expr == NULL)
|
if (expr == NULL)
|
||||||
{
|
{
|
||||||
@ -230,7 +230,7 @@ print_expr(Node * expr, List * rtable)
|
|||||||
* temporary here. where is keys list of list??
|
* temporary here. where is keys list of list??
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_keys(List * keys, List * rtable)
|
print_keys(List *keys, List *rtable)
|
||||||
{
|
{
|
||||||
List *k;
|
List *k;
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ print_keys(List * keys, List * rtable)
|
|||||||
* print targetlist in a more legible way.
|
* print targetlist in a more legible way.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_tl(List * tlist, List * rtable)
|
print_tl(List *tlist, List *rtable)
|
||||||
{
|
{
|
||||||
List *tl;
|
List *tl;
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ print_tl(List * tlist, List * rtable)
|
|||||||
* print out the tuple with the given TupleTableSlot
|
* print out the tuple with the given TupleTableSlot
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_slot(TupleTableSlot * slot)
|
print_slot(TupleTableSlot *slot)
|
||||||
{
|
{
|
||||||
if (!slot->val)
|
if (!slot->val)
|
||||||
{
|
{
|
||||||
@ -297,7 +297,7 @@ print_slot(TupleTableSlot * slot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
plannode_type(Plan * p)
|
plannode_type(Plan *p)
|
||||||
{
|
{
|
||||||
switch (nodeTag(p))
|
switch (nodeTag(p))
|
||||||
{
|
{
|
||||||
@ -375,7 +375,7 @@ plannode_type(Plan * p)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_plan_recursive(Plan * p, Query * parsetree, int indentLevel, char *label)
|
print_plan_recursive(Plan *p, Query *parsetree, int indentLevel, char *label)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char extraInfo[100];
|
char extraInfo[100];
|
||||||
@ -386,7 +386,7 @@ print_plan_recursive(Plan * p, Query * parsetree, int indentLevel, char *label)
|
|||||||
printf(" ");
|
printf(" ");
|
||||||
printf("%s%s :c=%.4f :s=%d :w=%d ", label, plannode_type(p),
|
printf("%s%s :c=%.4f :s=%d :w=%d ", label, plannode_type(p),
|
||||||
p->cost, p->plan_size, p->plan_width);
|
p->cost, p->plan_size, p->plan_width);
|
||||||
if (IsA(p, Scan) || IsA(p, SeqScan))
|
if (IsA(p, Scan) ||IsA(p, SeqScan))
|
||||||
{
|
{
|
||||||
RangeTblEntry *rte;
|
RangeTblEntry *rte;
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ print_plan_recursive(Plan * p, Query * parsetree, int indentLevel, char *label)
|
|||||||
prints just the plan node types */
|
prints just the plan node types */
|
||||||
|
|
||||||
void
|
void
|
||||||
print_plan(Plan * p, Query * parsetree)
|
print_plan(Plan *p, Query *parsetree)
|
||||||
{
|
{
|
||||||
print_plan_recursive(p, parsetree, 0, "");
|
print_plan_recursive(p, parsetree, 0, "");
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.8 1997/09/08 02:23:45 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.9 1997/09/08 21:44:11 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
|
||||||
@ -54,7 +54,7 @@
|
|||||||
static Datum readDatum(Oid type);
|
static Datum readDatum(Oid type);
|
||||||
|
|
||||||
static List *
|
static List *
|
||||||
toIntList(List * list)
|
toIntList(List *list)
|
||||||
{
|
{
|
||||||
List *l;
|
List *l;
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ _readQuery()
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_getPlan(Plan * node)
|
_getPlan(Plan *node)
|
||||||
{
|
{
|
||||||
char *token;
|
char *token;
|
||||||
int length;
|
int length;
|
||||||
@ -155,7 +155,7 @@ _getPlan(Plan * node)
|
|||||||
else
|
else
|
||||||
{ /* Disgusting hack until I figure out what
|
{ /* Disgusting hack until I figure out what
|
||||||
* to do here */
|
* to do here */
|
||||||
node->state = (EState *) ! NULL;
|
node->state = (EState *) !NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
token = lsptok(NULL, &length); /* eat :qptargetlist */
|
token = lsptok(NULL, &length); /* eat :qptargetlist */
|
||||||
@ -273,7 +273,7 @@ _readAppend()
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_getJoin(Join * node)
|
_getJoin(Join *node)
|
||||||
{
|
{
|
||||||
_getPlan((Plan *) node);
|
_getPlan((Plan *) node);
|
||||||
}
|
}
|
||||||
@ -396,7 +396,7 @@ _readHashJoin()
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_getScan(Scan * node)
|
_getScan(Scan *node)
|
||||||
{
|
{
|
||||||
char *token;
|
char *token;
|
||||||
int length;
|
int length;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: geqo_copy.c,v 1.3 1997/09/08 02:23:47 momjian Exp $
|
* $Id: geqo_copy.c,v 1.4 1997/09/08 21:44:13 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -56,7 +56,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
geqo_copy(Chromosome * chromo1, Chromosome * chromo2, int string_length)
|
geqo_copy(Chromosome *chromo1, Chromosome *chromo2, int string_length)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* CX operator according to Oliver et al
|
* CX operator according to Oliver et al
|
||||||
* (Proc 2nd Int'l Conf on GA's)
|
* (Proc 2nd Int'l Conf on GA's)
|
||||||
*
|
*
|
||||||
* $Id: geqo_cx.c,v 1.3 1997/09/08 02:23:49 momjian Exp $
|
* $Id: geqo_cx.c,v 1.4 1997/09/08 21:44:15 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -60,7 +60,7 @@
|
|||||||
* cycle crossover
|
* cycle crossover
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
cx(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene, City * city_table)
|
cx(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
|
||||||
{
|
{
|
||||||
|
|
||||||
int i,
|
int i,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* geqo_erx.c--
|
* geqo_erx.c--
|
||||||
* edge recombination crossover [ER]
|
* edge recombination crossover [ER]
|
||||||
*
|
*
|
||||||
* $Id: geqo_erx.c,v 1.4 1997/09/08 02:23:52 momjian Exp $
|
* $Id: geqo_erx.c,v 1.5 1997/09/08 21:44:16 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -52,11 +52,11 @@
|
|||||||
#include "optimizer/geqo_random.h"
|
#include "optimizer/geqo_random.h"
|
||||||
|
|
||||||
|
|
||||||
static int gimme_edge(Gene gene1, Gene gene2, Edge * edge_table);
|
static int gimme_edge(Gene gene1, Gene gene2, Edge *edge_table);
|
||||||
static void remove_gene(Gene gene, Edge edge, Edge * edge_table);
|
static void remove_gene(Gene gene, Edge edge, Edge *edge_table);
|
||||||
static Gene gimme_gene(Edge edge, Edge * edge_table);
|
static Gene gimme_gene(Edge edge, Edge *edge_table);
|
||||||
|
|
||||||
static Gene edge_failure(Gene * gene, int index, Edge * edge_table, int num_gene);
|
static Gene edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene);
|
||||||
|
|
||||||
|
|
||||||
/* alloc_edge_table--
|
/* alloc_edge_table--
|
||||||
@ -86,7 +86,7 @@ alloc_edge_table(int num_gene)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
free_edge_table(Edge * edge_table)
|
free_edge_table(Edge *edge_table)
|
||||||
{
|
{
|
||||||
pfree(edge_table);
|
pfree(edge_table);
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ free_edge_table(Edge * edge_table)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
float
|
float
|
||||||
gimme_edge_table(Gene * tour1, Gene * tour2, int num_gene, Edge * edge_table)
|
gimme_edge_table(Gene *tour1, Gene *tour2, int num_gene, Edge *edge_table)
|
||||||
{
|
{
|
||||||
int i,
|
int i,
|
||||||
index1,
|
index1,
|
||||||
@ -165,7 +165,7 @@ gimme_edge_table(Gene * tour1, Gene * tour2, int num_gene, Edge * edge_table)
|
|||||||
* 0 if edge was already registered and edge_table is unchanged
|
* 0 if edge was already registered and edge_table is unchanged
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
gimme_edge(Gene gene1, Gene gene2, Edge * edge_table)
|
gimme_edge(Gene gene1, Gene gene2, Edge *edge_table)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int edges;
|
int edges;
|
||||||
@ -207,7 +207,7 @@ gimme_edge(Gene gene1, Gene gene2, Edge * edge_table)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
gimme_tour(Edge * edge_table, Gene * new_gene, int num_gene)
|
gimme_tour(Edge *edge_table, Gene *new_gene, int num_gene)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int edge_failures = 0;
|
int edge_failures = 0;
|
||||||
@ -256,7 +256,7 @@ gimme_tour(Edge * edge_table, Gene * new_gene, int num_gene)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
remove_gene(Gene gene, Edge edge, Edge * edge_table)
|
remove_gene(Gene gene, Edge edge, Edge *edge_table)
|
||||||
{
|
{
|
||||||
int i,
|
int i,
|
||||||
j;
|
j;
|
||||||
@ -298,7 +298,7 @@ remove_gene(Gene gene, Edge edge, Edge * edge_table)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static Gene
|
static Gene
|
||||||
gimme_gene(Edge edge, Edge * edge_table)
|
gimme_gene(Edge edge, Edge *edge_table)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Gene friend;
|
Gene friend;
|
||||||
@ -389,7 +389,7 @@ gimme_gene(Edge edge, Edge * edge_table)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static Gene
|
static Gene
|
||||||
edge_failure(Gene * gene, int index, Edge * edge_table, int num_gene)
|
edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Gene fail_gene = gene[index];
|
Gene fail_gene = gene[index];
|
||||||
|
@ -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.14 1997/09/08 02:23:53 momjian Exp $
|
* $Id: geqo_eval.c,v 1.15 1997/09/08 21:44:19 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -50,13 +50,13 @@
|
|||||||
#include "optimizer/geqo_paths.h"
|
#include "optimizer/geqo_paths.h"
|
||||||
|
|
||||||
|
|
||||||
static List *gimme_clause_joins(Query * root, Rel * outer_rel, Rel * inner_rel);
|
static List *gimme_clause_joins(Query *root, Rel *outer_rel, Rel *inner_rel);
|
||||||
static Rel *gimme_clauseless_join(Rel * outer_rel, Rel * inner_rel);
|
static Rel *gimme_clauseless_join(Rel *outer_rel, Rel *inner_rel);
|
||||||
static Rel *init_join_rel(Rel * outer_rel, Rel * inner_rel, JInfo * joininfo);
|
static Rel *init_join_rel(Rel *outer_rel, Rel *inner_rel, JInfo *joininfo);
|
||||||
static List *new_join_tlist(List * tlist, List * other_relids, int first_resdomno);
|
static List *new_join_tlist(List *tlist, List *other_relids, int first_resdomno);
|
||||||
static List *new_joininfo_list(List * joininfo_list, List * join_relids);
|
static List *new_joininfo_list(List *joininfo_list, List *join_relids);
|
||||||
static void geqo_joinrel_size(Rel * joinrel, Rel * outer_rel, Rel * inner_rel);
|
static void geqo_joinrel_size(Rel *joinrel, Rel *outer_rel, Rel *inner_rel);
|
||||||
static Rel *geqo_nth(int stop, List * rels);
|
static Rel *geqo_nth(int stop, List *rels);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* geqo_eval--
|
* geqo_eval--
|
||||||
@ -64,7 +64,7 @@ static Rel *geqo_nth(int stop, List * rels);
|
|||||||
* Returns cost of a query tree as an individual of the population.
|
* Returns cost of a query tree as an individual of the population.
|
||||||
*/
|
*/
|
||||||
Cost
|
Cost
|
||||||
geqo_eval(Query * root, Gene * tour, int num_gene)
|
geqo_eval(Query *root, Gene *tour, int num_gene)
|
||||||
{
|
{
|
||||||
Rel *joinrel;
|
Rel *joinrel;
|
||||||
Cost fitness;
|
Cost fitness;
|
||||||
@ -99,7 +99,7 @@ geqo_eval(Query * root, Gene * tour, int num_gene)
|
|||||||
* Returns a new join relation incorporating all joins in a left-sided tree.
|
* Returns a new join relation incorporating all joins in a left-sided tree.
|
||||||
*/
|
*/
|
||||||
Rel *
|
Rel *
|
||||||
gimme_tree(Query * root, Gene * tour, int rel_count, int num_gene, Rel * outer_rel)
|
gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, Rel *outer_rel)
|
||||||
{
|
{
|
||||||
Rel *inner_rel; /* current relation */
|
Rel *inner_rel; /* current relation */
|
||||||
int base_rel_index;
|
int base_rel_index;
|
||||||
@ -191,7 +191,7 @@ gimme_tree(Query * root, Gene * tour, int rel_count, int num_gene, Rel * outer_r
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static List *
|
static List *
|
||||||
gimme_clause_joins(Query * root, Rel * outer_rel, Rel * inner_rel)
|
gimme_clause_joins(Query *root, Rel *outer_rel, Rel *inner_rel)
|
||||||
{
|
{
|
||||||
List *join_list = NIL;
|
List *join_list = NIL;
|
||||||
List *i = NIL;
|
List *i = NIL;
|
||||||
@ -244,7 +244,7 @@ gimme_clause_joins(Query * root, Rel * outer_rel, Rel * inner_rel)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static Rel *
|
static Rel *
|
||||||
gimme_clauseless_join(Rel * outer_rel, Rel * inner_rel)
|
gimme_clauseless_join(Rel *outer_rel, Rel *inner_rel)
|
||||||
{
|
{
|
||||||
return (init_join_rel(outer_rel, inner_rel, (JInfo *) NULL));
|
return (init_join_rel(outer_rel, inner_rel, (JInfo *) NULL));
|
||||||
}
|
}
|
||||||
@ -261,7 +261,7 @@ gimme_clauseless_join(Rel * outer_rel, Rel * inner_rel)
|
|||||||
* Returns the new join relation node.
|
* Returns the new join relation node.
|
||||||
*/
|
*/
|
||||||
static Rel *
|
static Rel *
|
||||||
init_join_rel(Rel * outer_rel, Rel * inner_rel, JInfo * joininfo)
|
init_join_rel(Rel *outer_rel, Rel *inner_rel, JInfo *joininfo)
|
||||||
{
|
{
|
||||||
Rel *joinrel = makeNode(Rel);
|
Rel *joinrel = makeNode(Rel);
|
||||||
List *joinrel_joininfo_list = NIL;
|
List *joinrel_joininfo_list = NIL;
|
||||||
@ -339,8 +339,8 @@ init_join_rel(Rel * outer_rel, Rel * inner_rel, JInfo * joininfo)
|
|||||||
* Returns the new target list.
|
* Returns the new target list.
|
||||||
*/
|
*/
|
||||||
static List *
|
static List *
|
||||||
new_join_tlist(List * tlist,
|
new_join_tlist(List *tlist,
|
||||||
List * other_relids,
|
List *other_relids,
|
||||||
int first_resdomno)
|
int first_resdomno)
|
||||||
{
|
{
|
||||||
int resdomno = first_resdomno - 1;
|
int resdomno = first_resdomno - 1;
|
||||||
@ -389,7 +389,7 @@ new_join_tlist(List * tlist,
|
|||||||
* Returns a list of joininfo nodes, new and old.
|
* Returns a list of joininfo nodes, new and old.
|
||||||
*/
|
*/
|
||||||
static List *
|
static List *
|
||||||
new_joininfo_list(List * joininfo_list, List * join_relids)
|
new_joininfo_list(List *joininfo_list, List *join_relids)
|
||||||
{
|
{
|
||||||
List *current_joininfo_list = NIL;
|
List *current_joininfo_list = NIL;
|
||||||
List *new_otherrels = NIL;
|
List *new_otherrels = NIL;
|
||||||
@ -454,7 +454,7 @@ new_joininfo_list(List * joininfo_list, List * join_relids)
|
|||||||
* Modifies the joininfo field of appropriate rel nodes.
|
* Modifies the joininfo field of appropriate rel nodes.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
geqo_add_new_joininfos(Query * root, List * joinrels, List * outerrels)
|
geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
|
||||||
{
|
{
|
||||||
List *xjoinrel = NIL;
|
List *xjoinrel = NIL;
|
||||||
List *xrelid = NIL;
|
List *xrelid = NIL;
|
||||||
@ -603,7 +603,7 @@ geqo_add_new_joininfos(Query * root, List * joinrels, List * outerrels)
|
|||||||
* Returns the list of final join relations.
|
* Returns the list of final join relations.
|
||||||
*/
|
*/
|
||||||
static List *
|
static List *
|
||||||
geqo_final_join_rels(List * join_rel_list)
|
geqo_final_join_rels(List *join_rel_list)
|
||||||
{
|
{
|
||||||
List *xrel = NIL;
|
List *xrel = NIL;
|
||||||
List *temp = NIL;
|
List *temp = NIL;
|
||||||
@ -649,7 +649,7 @@ geqo_final_join_rels(List * join_rel_list)
|
|||||||
* Modifies the superrels field of rel
|
* Modifies the superrels field of rel
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
add_superrels(Rel * rel, Rel * super_rel)
|
add_superrels(Rel *rel, Rel *super_rel)
|
||||||
{
|
{
|
||||||
rel->superrels = lappend(rel->superrels, super_rel);
|
rel->superrels = lappend(rel->superrels, super_rel);
|
||||||
}
|
}
|
||||||
@ -664,13 +664,13 @@ add_superrels(Rel * rel, Rel * super_rel)
|
|||||||
* Returns non-nil if rel1 and rel2 do not overlap.
|
* Returns non-nil if rel1 and rel2 do not overlap.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
nonoverlap_rels(Rel * rel1, Rel * rel2)
|
nonoverlap_rels(Rel *rel1, Rel *rel2)
|
||||||
{
|
{
|
||||||
return (nonoverlap_sets(rel1->relids, rel2->relids));
|
return (nonoverlap_sets(rel1->relids, rel2->relids));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
nonoverlap_sets(List * s1, List * s2)
|
nonoverlap_sets(List *s1, List *s2)
|
||||||
{
|
{
|
||||||
List *x = NIL;
|
List *x = NIL;
|
||||||
|
|
||||||
@ -692,7 +692,7 @@ nonoverlap_sets(List * s1, List * s2)
|
|||||||
* long join queries; so get logarithm of size when MAXINT overflow;
|
* long join queries; so get logarithm of size when MAXINT overflow;
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
geqo_joinrel_size(Rel * joinrel, Rel * outer_rel, Rel * inner_rel)
|
geqo_joinrel_size(Rel *joinrel, Rel *outer_rel, Rel *inner_rel)
|
||||||
{
|
{
|
||||||
Cost temp;
|
Cost temp;
|
||||||
int ntuples;
|
int ntuples;
|
||||||
@ -726,7 +726,7 @@ geqo_log(double x, double b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Rel *
|
static Rel *
|
||||||
geqo_nth(int stop, List * rels)
|
geqo_nth(int stop, List *rels)
|
||||||
{
|
{
|
||||||
List *r;
|
List *r;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user