mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
pgindent run before 6.3 release, with Thomas' requested changes.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.40 1998/02/23 02:54:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.41 1998/02/26 04:32:04 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -35,7 +35,7 @@
|
||||
* this copy function only copies the "lcons-cells" of the list but not
|
||||
* its contents. (good for list of pointers as well as list of integers).
|
||||
*/
|
||||
List *
|
||||
List *
|
||||
listCopy(List *list)
|
||||
{
|
||||
List *newlist = NIL;
|
||||
@@ -79,8 +79,8 @@ listCopy(List *list)
|
||||
static void
|
||||
CopyPlanFields(Plan *from, Plan *newnode)
|
||||
{
|
||||
extern List *SS_pull_subplan (void *expr);
|
||||
|
||||
extern List *SS_pull_subplan(void *expr);
|
||||
|
||||
newnode->cost = from->cost;
|
||||
newnode->plan_size = from->plan_size;
|
||||
newnode->plan_width = from->plan_width;
|
||||
@@ -90,12 +90,12 @@ CopyPlanFields(Plan *from, Plan *newnode)
|
||||
newnode->qual = copyObject(from->qual);
|
||||
newnode->lefttree = copyObject(from->lefttree);
|
||||
newnode->righttree = copyObject(from->righttree);
|
||||
newnode->extParam = listCopy (from->extParam);
|
||||
newnode->locParam = listCopy (from->locParam);
|
||||
newnode->chgParam = listCopy (from->chgParam);
|
||||
newnode->extParam = listCopy(from->extParam);
|
||||
newnode->locParam = listCopy(from->locParam);
|
||||
newnode->chgParam = listCopy(from->chgParam);
|
||||
Node_Copy(from, newnode, initPlan);
|
||||
if ( from->subPlan != NULL )
|
||||
newnode->subPlan = SS_pull_subplan (newnode->qual);
|
||||
if (from->subPlan != NULL)
|
||||
newnode->subPlan = SS_pull_subplan(newnode->qual);
|
||||
else
|
||||
newnode->subPlan = NULL;
|
||||
newnode->nParamExec = from->nParamExec;
|
||||
@@ -471,7 +471,7 @@ _copySort(Sort *from)
|
||||
Node_Copy(from, newnode, sortstate);
|
||||
Node_Copy(from, newnode, psortstate);
|
||||
newnode->cleaned = from->cleaned;
|
||||
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
@@ -484,13 +484,13 @@ static Group *
|
||||
_copyGroup(Group *from)
|
||||
{
|
||||
Group *newnode = makeNode(Group);
|
||||
|
||||
|
||||
CopyPlanFields((Plan *) from, (Plan *) newnode);
|
||||
|
||||
newnode->tuplePerGroup = from->tuplePerGroup;
|
||||
newnode->numCols = from->numCols;
|
||||
newnode->grpColIdx = palloc (from->numCols * sizeof (AttrNumber));
|
||||
memcpy (newnode->grpColIdx, from->grpColIdx, from->numCols * sizeof (AttrNumber));
|
||||
newnode->grpColIdx = palloc(from->numCols * sizeof(AttrNumber));
|
||||
memcpy(newnode->grpColIdx, from->grpColIdx, from->numCols * sizeof(AttrNumber));
|
||||
Node_Copy(from, newnode, grpstate);
|
||||
|
||||
return newnode;
|
||||
@@ -520,12 +520,12 @@ _copyAgg(Agg *from)
|
||||
static GroupClause *
|
||||
_copyGroupClause(GroupClause *from)
|
||||
{
|
||||
GroupClause *newnode = makeNode(GroupClause);
|
||||
GroupClause *newnode = makeNode(GroupClause);
|
||||
|
||||
Node_Copy(from, newnode, entry);
|
||||
newnode->grpOpoid = from->grpOpoid;
|
||||
Node_Copy(from, newnode, entry);
|
||||
newnode->grpOpoid = from->grpOpoid;
|
||||
|
||||
return newnode;
|
||||
return newnode;
|
||||
}
|
||||
|
||||
|
||||
@@ -592,13 +592,13 @@ _copyHash(Hash *from)
|
||||
static SubPlan *
|
||||
_copySubPlan(SubPlan *from)
|
||||
{
|
||||
SubPlan *newnode = makeNode(SubPlan);
|
||||
|
||||
SubPlan *newnode = makeNode(SubPlan);
|
||||
|
||||
Node_Copy(from, newnode, plan);
|
||||
newnode->plan_id = from->plan_id;
|
||||
Node_Copy(from, newnode, rtable);
|
||||
newnode->setParam = listCopy (from->setParam);
|
||||
newnode->parParam = listCopy (from->parParam);
|
||||
newnode->setParam = listCopy(from->setParam);
|
||||
newnode->parParam = listCopy(from->parParam);
|
||||
Node_Copy(from, newnode, sublink);
|
||||
newnode->shutdown = from->shutdown;
|
||||
|
||||
@@ -761,7 +761,7 @@ _copyConst(Const *from)
|
||||
* XXX super cheesy hack until parser/planner
|
||||
* puts in the right values here.
|
||||
*
|
||||
* But I like cheese.
|
||||
* But I like cheese.
|
||||
* ----------------
|
||||
*/
|
||||
if (!from->constisnull && cached_type != from->consttype)
|
||||
@@ -931,7 +931,7 @@ _copyAggreg(Aggreg *from)
|
||||
static SubLink *
|
||||
_copySubLink(SubLink *from)
|
||||
{
|
||||
SubLink *newnode = makeNode(SubLink);
|
||||
SubLink *newnode = makeNode(SubLink);
|
||||
|
||||
/* ----------------
|
||||
* copy remainder of node
|
||||
@@ -1049,7 +1049,7 @@ _copyRel(Rel *from)
|
||||
newnode->relam = from->relam;
|
||||
newnode->indproc = from->indproc;
|
||||
Node_Copy(from, newnode, indpred);
|
||||
|
||||
|
||||
if (from->ordering)
|
||||
{
|
||||
for (len = 0; from->ordering[len] != 0; len++)
|
||||
@@ -1389,7 +1389,7 @@ _copyHInfo(HInfo *from)
|
||||
* copy remainder of node
|
||||
* ----------------
|
||||
*/
|
||||
CopyJoinMethodFields((JoinMethod *)from, (JoinMethod *)newnode);
|
||||
CopyJoinMethodFields((JoinMethod *) from, (JoinMethod *) newnode);
|
||||
newnode->hashop = from->hashop;
|
||||
|
||||
return newnode;
|
||||
@@ -1408,7 +1408,7 @@ _copyMInfo(MInfo *from)
|
||||
* copy remainder of node
|
||||
* ----------------
|
||||
*/
|
||||
CopyJoinMethodFields((JoinMethod *)from, (JoinMethod *)newnode);
|
||||
CopyJoinMethodFields((JoinMethod *) from, (JoinMethod *) newnode);
|
||||
Node_Copy(from, newnode, m_ordering);
|
||||
|
||||
return newnode;
|
||||
@@ -1498,9 +1498,9 @@ _copyRangeTblEntry(RangeTblEntry *from)
|
||||
newnode->relid = from->relid;
|
||||
newnode->inh = from->inh;
|
||||
newnode->inFromCl = from->inFromCl;
|
||||
newnode->skipAcl = from->skipAcl;
|
||||
newnode->skipAcl = from->skipAcl;
|
||||
|
||||
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
@@ -1545,7 +1545,7 @@ static Query *
|
||||
_copyQuery(Query *from)
|
||||
{
|
||||
Query *newnode = makeNode(Query);
|
||||
|
||||
|
||||
newnode->commandType = from->commandType;
|
||||
if (from->utilityStmt && nodeTag(from->utilityStmt) == T_NotifyStmt)
|
||||
{
|
||||
@@ -1576,13 +1576,14 @@ _copyQuery(Query *from)
|
||||
|
||||
if (from->unionClause)
|
||||
{
|
||||
List *ulist, *temp_list = NIL;
|
||||
List *ulist,
|
||||
*temp_list = NIL;
|
||||
|
||||
foreach(ulist, from->unionClause)
|
||||
temp_list = lappend(temp_list,copyObject(lfirst(ulist)));
|
||||
temp_list = lappend(temp_list, copyObject(lfirst(ulist)));
|
||||
newnode->unionClause = temp_list;
|
||||
}
|
||||
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
@@ -1625,7 +1626,7 @@ _copyValue(Value *from)
|
||||
* recursively copies its items.
|
||||
* ----------------
|
||||
*/
|
||||
void *
|
||||
void *
|
||||
copyObject(void *from)
|
||||
{
|
||||
void *retval;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.15 1998/02/13 03:27:44 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.16 1998/02/26 04:32:07 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -512,7 +512,7 @@ _equalSubPlan(SubPlan *a, SubPlan *b)
|
||||
|
||||
if (!equal((a->sublink->oper), (b->sublink->oper)))
|
||||
return (false);
|
||||
|
||||
|
||||
return (true);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.11 1998/01/15 18:59:23 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.12 1998/02/26 04:32:08 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* XXX a few of the following functions are duplicated to handle
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "utils/elog.h"
|
||||
#include "utils/palloc.h"
|
||||
|
||||
List *
|
||||
List *
|
||||
makeList(void *elem,...)
|
||||
{
|
||||
va_list args;
|
||||
@@ -57,7 +57,7 @@ makeList(void *elem,...)
|
||||
return (retval);
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
lcons(void *obj, List *list)
|
||||
{
|
||||
List *l = makeNode(List);
|
||||
@@ -67,7 +67,7 @@ lcons(void *obj, List *list)
|
||||
return l;
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
lconsi(int datum, List *list)
|
||||
{
|
||||
List *l = makeNode(List);
|
||||
@@ -77,19 +77,19 @@ lconsi(int datum, List *list)
|
||||
return l;
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
lappend(List *list, void *obj)
|
||||
{
|
||||
return nconc(list, lcons(obj, NIL));
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
lappendi(List *list, int datum)
|
||||
{
|
||||
return nconc(list, lconsi(datum, NIL));
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
nconc(List *l1, List *l2)
|
||||
{
|
||||
List *temp;
|
||||
@@ -109,7 +109,7 @@ nconc(List *l1, List *l2)
|
||||
}
|
||||
|
||||
|
||||
List *
|
||||
List *
|
||||
nreverse(List *list)
|
||||
{
|
||||
List *rlist = NIL;
|
||||
@@ -131,7 +131,7 @@ nreverse(List *list)
|
||||
return (list);
|
||||
}
|
||||
|
||||
Value *
|
||||
Value *
|
||||
makeInteger(long i)
|
||||
{
|
||||
Value *v = makeNode(Value);
|
||||
@@ -141,7 +141,7 @@ makeInteger(long i)
|
||||
return v;
|
||||
}
|
||||
|
||||
Value *
|
||||
Value *
|
||||
makeFloat(double d)
|
||||
{
|
||||
Value *v = makeNode(Value);
|
||||
@@ -151,7 +151,7 @@ makeFloat(double d)
|
||||
return v;
|
||||
}
|
||||
|
||||
Value *
|
||||
Value *
|
||||
makeString(char *str)
|
||||
{
|
||||
Value *v = makeNode(Value);
|
||||
@@ -162,7 +162,7 @@ makeString(char *str)
|
||||
}
|
||||
|
||||
/* n starts with 0 */
|
||||
void *
|
||||
void *
|
||||
nth(int n, List *l)
|
||||
{
|
||||
/* XXX assume list is long enough */
|
||||
@@ -228,7 +228,7 @@ freeList(List *list)
|
||||
/*
|
||||
* below are for backwards compatibility
|
||||
*/
|
||||
List *
|
||||
List *
|
||||
append(List *l1, List *l2)
|
||||
{
|
||||
List *newlist,
|
||||
@@ -250,7 +250,7 @@ append(List *l1, List *l2)
|
||||
/*
|
||||
* below are for backwards compatibility
|
||||
*/
|
||||
List *
|
||||
List *
|
||||
intAppend(List *l1, List *l2)
|
||||
{
|
||||
List *newlist,
|
||||
@@ -299,7 +299,7 @@ same(List *l1, List *l2)
|
||||
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
LispUnion(List *l1, List *l2)
|
||||
{
|
||||
List *retval = NIL;
|
||||
@@ -331,7 +331,7 @@ LispUnion(List *l1, List *l2)
|
||||
return (retval);
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
LispUnioni(List *l1, List *l2)
|
||||
{
|
||||
List *retval = NIL;
|
||||
@@ -394,7 +394,7 @@ intMember(int l1, List *l2)
|
||||
* lremove -
|
||||
* only does pointer comparisons. Removes 'elem' from the the linked list.
|
||||
*/
|
||||
List *
|
||||
List *
|
||||
lremove(void *elem, List *list)
|
||||
{
|
||||
List *l;
|
||||
@@ -421,7 +421,7 @@ lremove(void *elem, List *list)
|
||||
return result;
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
LispRemove(void *elem, List *list)
|
||||
{
|
||||
List *temp = NIL;
|
||||
@@ -446,7 +446,7 @@ LispRemove(void *elem, List *list)
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
List *
|
||||
List *
|
||||
intLispRemove(int elem, List *list)
|
||||
{
|
||||
List *temp = NIL;
|
||||
@@ -472,7 +472,7 @@ intLispRemove(int elem, List *list)
|
||||
|
||||
#endif
|
||||
|
||||
List *
|
||||
List *
|
||||
set_difference(List *l1, List *l2)
|
||||
{
|
||||
List *temp1 = NIL;
|
||||
@@ -489,7 +489,7 @@ set_difference(List *l1, List *l2)
|
||||
return (result);
|
||||
}
|
||||
|
||||
List *
|
||||
List *
|
||||
set_differencei(List *l1, List *l2)
|
||||
{
|
||||
List *temp1 = NIL;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.8 1998/02/21 16:58:22 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.9 1998/02/26 04:32:08 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
|
||||
@@ -27,7 +27,7 @@
|
||||
* makeOper -
|
||||
* creates an Oper node
|
||||
*/
|
||||
Oper *
|
||||
Oper *
|
||||
makeOper(Oid opno,
|
||||
Oid opid,
|
||||
Oid opresulttype,
|
||||
@@ -49,7 +49,7 @@ makeOper(Oid opno,
|
||||
* creates a Var node
|
||||
*
|
||||
*/
|
||||
Var *
|
||||
Var *
|
||||
makeVar(Index varno,
|
||||
AttrNumber varattno,
|
||||
Oid vartype,
|
||||
@@ -75,7 +75,7 @@ makeVar(Index varno,
|
||||
* makeResdom -
|
||||
* creates a Resdom (Result Domain) node
|
||||
*/
|
||||
Resdom *
|
||||
Resdom *
|
||||
makeResdom(AttrNumber resno,
|
||||
Oid restype,
|
||||
int16 restypmod,
|
||||
@@ -100,7 +100,7 @@ makeResdom(AttrNumber resno,
|
||||
* makeConst -
|
||||
* creates a Const node
|
||||
*/
|
||||
Const *
|
||||
Const *
|
||||
makeConst(Oid consttype,
|
||||
int constlen,
|
||||
Datum constvalue,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.6 1997/09/08 21:44:06 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.7 1998/02/26 04:32:09 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -89,7 +89,7 @@ var_is_rel(Var *var)
|
||||
* Returns the modified oper node.
|
||||
*
|
||||
*/
|
||||
Oper *
|
||||
Oper *
|
||||
replace_opid(Oper *oper)
|
||||
{
|
||||
oper->opid = get_opcode(oper->opno);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.4 1997/09/18 20:20:43 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.5 1998/02/26 04:32:10 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* Andrew Yu Oct 20, 1994 file creation
|
||||
@@ -31,7 +31,7 @@
|
||||
* macro makeNode. eg. to create a Resdom node, use makeNode(Resdom)
|
||||
*
|
||||
*/
|
||||
Node *
|
||||
Node *
|
||||
newNode(Size size, NodeTag tag)
|
||||
{
|
||||
Node *newNode;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.32 1998/02/21 18:17:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.33 1998/02/26 04:32:12 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@@ -102,9 +102,9 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
|
||||
appendStringInfo(str, " :rangetable ");
|
||||
_outNode(str, node->rangetable);
|
||||
appendStringInfo(str, " :lossy ");
|
||||
appendStringInfo(str, (node->lossy ? "true": "false"));
|
||||
appendStringInfo(str, (node->lossy ? "true" : "false"));
|
||||
appendStringInfo(str, " :unique ");
|
||||
appendStringInfo(str, (node->unique ? "true": "false"));
|
||||
appendStringInfo(str, (node->unique ? "true" : "false"));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -117,7 +117,7 @@ _outColumnDef(StringInfo str, ColumnDef *node)
|
||||
appendStringInfo(str, " :typename ");
|
||||
_outNode(str, node->typename);
|
||||
appendStringInfo(str, " :is_not_null ");
|
||||
appendStringInfo(str, (node->is_not_null ? "true": "false"));
|
||||
appendStringInfo(str, (node->is_not_null ? "true" : "false"));
|
||||
appendStringInfo(str, " :defval ");
|
||||
appendStringInfo(str, node->defval);
|
||||
appendStringInfo(str, " :constraints");
|
||||
@@ -127,8 +127,8 @@ _outColumnDef(StringInfo str, ColumnDef *node)
|
||||
static void
|
||||
_outTypeName(StringInfo str, TypeName *node)
|
||||
{
|
||||
char buf[500];
|
||||
|
||||
char buf[500];
|
||||
|
||||
appendStringInfo(str, "TYPENAME");
|
||||
|
||||
appendStringInfo(str, " :name ");
|
||||
@@ -138,7 +138,7 @@ _outTypeName(StringInfo str, TypeName *node)
|
||||
appendStringInfo(str, " :setof ");
|
||||
appendStringInfo(str, (node->setof ? "true" : "false"));
|
||||
appendStringInfo(str, " :typmod ");
|
||||
sprintf(buf," %d ", node->typmod);
|
||||
sprintf(buf, " %d ", node->typmod);
|
||||
appendStringInfo(str, buf);
|
||||
appendStringInfo(str, " :arrayBounds ");
|
||||
_outNode(str, node->arrayBounds);
|
||||
@@ -163,11 +163,11 @@ static void
|
||||
_outQuery(StringInfo str, Query *node)
|
||||
{
|
||||
char buf[500];
|
||||
|
||||
|
||||
appendStringInfo(str, "QUERY");
|
||||
|
||||
appendStringInfo(str, " :command ");
|
||||
sprintf(buf," %d ", node->commandType);
|
||||
sprintf(buf, " %d ", node->commandType);
|
||||
appendStringInfo(str, buf);
|
||||
|
||||
if (node->utilityStmt)
|
||||
@@ -227,26 +227,26 @@ _outQuery(StringInfo str, Query *node)
|
||||
appendStringInfo(str, " :groupClause ");
|
||||
_outNode(str, node->groupClause);
|
||||
appendStringInfo(str, " :havingQual ");
|
||||
_outNode(str, node->havingQual);
|
||||
_outNode(str, node->havingQual);
|
||||
appendStringInfo(str, " :hasAggs ");
|
||||
appendStringInfo(str, (node->hasAggs ? "true" : "false"));
|
||||
appendStringInfo(str, " :hasSubLinks ");
|
||||
appendStringInfo(str, (node->hasSubLinks ? "true" : "false"));
|
||||
appendStringInfo(str, " :unionClause ");
|
||||
_outNode(str, node->unionClause);
|
||||
_outNode(str, node->unionClause);
|
||||
}
|
||||
|
||||
static void
|
||||
_outSortClause(StringInfo str, SortClause *node)
|
||||
{
|
||||
char buf[500];
|
||||
|
||||
|
||||
appendStringInfo(str, "SORTCLAUSE");
|
||||
|
||||
appendStringInfo(str, " :resdom ");
|
||||
_outNode(str, node->resdom);
|
||||
appendStringInfo(str, " :opoid ");
|
||||
sprintf(buf," %u ", node->opoid);
|
||||
sprintf(buf, " %u ", node->opoid);
|
||||
appendStringInfo(str, buf);
|
||||
}
|
||||
|
||||
@@ -254,13 +254,13 @@ static void
|
||||
_outGroupClause(StringInfo str, GroupClause *node)
|
||||
{
|
||||
char buf[500];
|
||||
|
||||
|
||||
appendStringInfo(str, "GROUPCLAUSE");
|
||||
|
||||
appendStringInfo(str, " :entry ");
|
||||
_outNode(str, node->entry);
|
||||
appendStringInfo(str, " :grpOpoid ");
|
||||
sprintf(buf," %u ", node->grpOpoid);
|
||||
sprintf(buf, " %u ", node->grpOpoid);
|
||||
appendStringInfo(str, buf);
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ _outPlanInfo(StringInfo str, Plan *node)
|
||||
sprintf(buf, " :width %d ", node->plan_width);
|
||||
appendStringInfo(str, buf);
|
||||
appendStringInfo(str, " :state ");
|
||||
appendStringInfo(str, node->state ? "not-NULL" : "<>");
|
||||
appendStringInfo(str, node->state ? "not-NULL" : "<>");
|
||||
appendStringInfo(str, " :qptargetlist ");
|
||||
_outNode(str, node->targetlist);
|
||||
appendStringInfo(str, " :qpqual ");
|
||||
@@ -428,9 +428,9 @@ _outSubPlan(StringInfo str, SubPlan *node)
|
||||
appendStringInfo(str, " :rtable ");
|
||||
_outNode(str, node->rtable);
|
||||
appendStringInfo(str, " :setprm ");
|
||||
_outIntList (str, node->setParam);
|
||||
_outIntList(str, node->setParam);
|
||||
appendStringInfo(str, " :parprm ");
|
||||
_outIntList (str, node->parParam);
|
||||
_outIntList(str, node->parParam);
|
||||
appendStringInfo(str, " :slink ");
|
||||
_outNode(str, node->sublink);
|
||||
}
|
||||
@@ -1815,7 +1815,7 @@ _outNode(StringInfo str, void *obj)
|
||||
* nodeToString -
|
||||
* returns the ascii representation of the Node
|
||||
*/
|
||||
char *
|
||||
char *
|
||||
nodeToString(void *obj)
|
||||
{
|
||||
StringInfo str;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.10 1998/01/07 21:03:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.11 1998/02/26 04:32:16 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -28,7 +28,7 @@
|
||||
* stringToNode -
|
||||
* returns a Node with a given legal ascii representation
|
||||
*/
|
||||
void *
|
||||
void *
|
||||
stringToNode(char *str)
|
||||
{
|
||||
void *retval;
|
||||
@@ -94,7 +94,7 @@ nodeTokenType(char *token, int length)
|
||||
|
||||
retval = (*token != '.') ? T_Integer : T_Float;
|
||||
}
|
||||
else if (isalpha(*token) || *token == '_' ||
|
||||
else if (isalpha(*token) || *token == '_' ||
|
||||
(token[0] == '<' && token[1] == '>'))
|
||||
retval = ATOM_TOKEN;
|
||||
else if (*token == '(')
|
||||
@@ -117,7 +117,7 @@ nodeTokenType(char *token, int length)
|
||||
* returning a token by calling lsptok with length == NULL.
|
||||
*
|
||||
*/
|
||||
char *
|
||||
char *
|
||||
lsptok(char *string, int *length)
|
||||
{
|
||||
static char *local_str;
|
||||
@@ -151,8 +151,8 @@ lsptok(char *string, int *length)
|
||||
(*length)++;
|
||||
local_str++;
|
||||
}
|
||||
/* NULL */
|
||||
else if (local_str[0] == '<' && local_str[1] == '>' )
|
||||
/* NULL */
|
||||
else if (local_str[0] == '<' && local_str[1] == '>')
|
||||
{
|
||||
*length = 0;
|
||||
local_str += 2;
|
||||
@@ -182,7 +182,7 @@ lsptok(char *string, int *length)
|
||||
* Secrets: He assumes that lsptok already has the string (see below).
|
||||
* Any callers should set read_car_only to true.
|
||||
*/
|
||||
void *
|
||||
void *
|
||||
nodeRead(bool read_car_only)
|
||||
{
|
||||
char *token;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.27 1998/02/21 18:17:58 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.28 1998/02/26 04:32:17 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||
@@ -76,7 +76,7 @@ _readQuery()
|
||||
Query *local_node;
|
||||
char *token;
|
||||
int length;
|
||||
|
||||
|
||||
local_node = makeNode(Query);
|
||||
|
||||
token = lsptok(NULL, &length); /* skip the :command */
|
||||
@@ -84,7 +84,7 @@ _readQuery()
|
||||
local_node->commandType = atoi(token);
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :utility */
|
||||
/* we can't get create or index here, can we? */
|
||||
/* we can't get create or index here, can we? */
|
||||
|
||||
token = lsptok(NULL, &length); /* get the notify name if any */
|
||||
if (length == 0)
|
||||
@@ -94,7 +94,7 @@ _readQuery()
|
||||
NotifyStmt *n = makeNode(NotifyStmt);
|
||||
|
||||
n->relname = palloc(length + 1);
|
||||
StrNCpy(n->relname, token, length+1);
|
||||
StrNCpy(n->relname, token, length + 1);
|
||||
local_node->utilityStmt = (Node *) n;
|
||||
}
|
||||
|
||||
@@ -109,21 +109,21 @@ _readQuery()
|
||||
else
|
||||
{
|
||||
local_node->into = palloc(length + 1);
|
||||
StrNCpy(local_node->into, token, length+1);
|
||||
StrNCpy(local_node->into, token, length + 1);
|
||||
}
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :isPortal */
|
||||
token = lsptok(NULL, &length); /* get isPortal */
|
||||
local_node->isPortal = (token[0] == 't') ? true : false;
|
||||
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :isBinary */
|
||||
token = lsptok(NULL, &length); /* get isBinary */
|
||||
local_node->isBinary = (token[0] == 't') ? true : false;
|
||||
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :unionall */
|
||||
token = lsptok(NULL, &length); /* get unionall */
|
||||
local_node->unionall = (token[0] == 't') ? true : false;
|
||||
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :uniqueFlag */
|
||||
token = lsptok(NULL, &length); /* get uniqueFlag */
|
||||
if (length == 0)
|
||||
@@ -131,7 +131,7 @@ _readQuery()
|
||||
else
|
||||
{
|
||||
local_node->uniqueFlag = palloc(length + 1);
|
||||
StrNCpy(local_node->uniqueFlag, token, length+1);
|
||||
StrNCpy(local_node->uniqueFlag, token, length + 1);
|
||||
}
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :sortClause */
|
||||
@@ -184,7 +184,7 @@ _readSortClause()
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :opoid */
|
||||
token = lsptok(NULL, &length); /* get opoid */
|
||||
local_node->opoid = strtoul(token,NULL,10);
|
||||
local_node->opoid = strtoul(token, NULL, 10);
|
||||
|
||||
return (local_node);
|
||||
}
|
||||
@@ -207,7 +207,7 @@ _readGroupClause()
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :grpOpoid */
|
||||
token = lsptok(NULL, &length); /* get grpOpoid */
|
||||
local_node->grpOpoid = strtoul(token,NULL,10);
|
||||
local_node->grpOpoid = strtoul(token, NULL, 10);
|
||||
|
||||
return (local_node);
|
||||
}
|
||||
@@ -328,11 +328,11 @@ _readAppend()
|
||||
local_node->unionplans = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :unionrts */
|
||||
local_node->unionrts = nodeRead(true); /* now read it */
|
||||
local_node->unionrts = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :unionrelid */
|
||||
token = lsptok(NULL, &length); /* get unionrelid */
|
||||
local_node->unionrelid = strtoul(token,NULL,10);
|
||||
local_node->unionrelid = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :unionrtentries */
|
||||
local_node->unionrtentries = nodeRead(true); /* now read it */
|
||||
@@ -438,7 +438,7 @@ _readHashJoin()
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :hashjoinop */
|
||||
token = lsptok(NULL, &length); /* get hashjoinop */
|
||||
local_node->hashjoinop = strtoul(token,NULL,10);
|
||||
local_node->hashjoinop = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :hashjointable */
|
||||
token = lsptok(NULL, &length); /* eat hashjointable */
|
||||
@@ -479,7 +479,7 @@ _getScan(Scan *node)
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :scanrelid */
|
||||
token = lsptok(NULL, &length); /* get scanrelid */
|
||||
node->scanrelid = strtoul(token,NULL,10);
|
||||
node->scanrelid = strtoul(token, NULL, 10);
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -718,12 +718,12 @@ _readResdom()
|
||||
else
|
||||
{
|
||||
local_node->resname = (char *) palloc(length + 1);
|
||||
StrNCpy(local_node->resname, token, length+1);
|
||||
StrNCpy(local_node->resname, token, length + 1);
|
||||
}
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :reskey */
|
||||
token = lsptok(NULL, &length); /* get reskey */
|
||||
local_node->reskey = strtoul(token,NULL,10);
|
||||
local_node->reskey = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :reskeyop */
|
||||
token = lsptok(NULL, &length); /* get reskeyop */
|
||||
@@ -808,7 +808,7 @@ _readVar()
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :varno */
|
||||
token = lsptok(NULL, &length); /* get varno */
|
||||
local_node->varno = strtoul(token,NULL,10);
|
||||
local_node->varno = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :varattno */
|
||||
token = lsptok(NULL, &length); /* get varattno */
|
||||
@@ -854,7 +854,7 @@ _readArray()
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :arrayelemtype */
|
||||
token = lsptok(NULL, &length); /* get arrayelemtype */
|
||||
local_node->arrayelemtype = strtoul(token,NULL,10);
|
||||
local_node->arrayelemtype = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :arrayelemlength */
|
||||
token = lsptok(NULL, &length); /* get arrayelemlength */
|
||||
@@ -896,7 +896,7 @@ _readArrayRef()
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :refelemtype */
|
||||
token = lsptok(NULL, &length); /* get refelemtype */
|
||||
local_node->refelemtype = strtoul(token,NULL,10);
|
||||
local_node->refelemtype = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :refattrlength */
|
||||
token = lsptok(NULL, &length); /* get refattrlength */
|
||||
@@ -947,7 +947,7 @@ _readConst()
|
||||
|
||||
token = lsptok(NULL, &length); /* get :constlen */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
local_node->constlen = strtol(token,NULL,10);
|
||||
local_node->constlen = strtol(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* get :constisnull */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
@@ -1112,7 +1112,7 @@ _readParam()
|
||||
else
|
||||
{
|
||||
local_node->paramname = (char *) palloc(length + 1);
|
||||
StrNCpy(local_node->paramname, token, length+1);
|
||||
StrNCpy(local_node->paramname, token, length + 1);
|
||||
}
|
||||
|
||||
token = lsptok(NULL, &length); /* get :paramtype */
|
||||
@@ -1143,7 +1143,7 @@ _readAggreg()
|
||||
token = lsptok(NULL, &length); /* eat :aggname */
|
||||
token = lsptok(NULL, &length); /* get aggname */
|
||||
local_node->aggname = (char *) palloc(length + 1);
|
||||
StrNCpy(local_node->aggname, token, length+1);
|
||||
StrNCpy(local_node->aggname, token, length + 1);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :basetype */
|
||||
token = lsptok(NULL, &length); /* get basetype */
|
||||
@@ -1176,7 +1176,7 @@ _readAggreg()
|
||||
static SubLink *
|
||||
_readSubLink()
|
||||
{
|
||||
SubLink *local_node;
|
||||
SubLink *local_node;
|
||||
char *token;
|
||||
int length;
|
||||
|
||||
@@ -1194,7 +1194,7 @@ _readSubLink()
|
||||
local_node->lefthand = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :oper */
|
||||
local_node->oper = nodeRead(true); /* now read it */
|
||||
local_node->oper = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :subselect */
|
||||
local_node->subselect = nodeRead(true); /* now read it */
|
||||
@@ -1367,7 +1367,7 @@ _readRangeTblEntry()
|
||||
else
|
||||
{
|
||||
local_node->relname = (char *) palloc(length + 1);
|
||||
StrNCpy(local_node->relname, token, length+1);
|
||||
StrNCpy(local_node->relname, token, length + 1);
|
||||
}
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :refname */
|
||||
@@ -1377,12 +1377,12 @@ _readRangeTblEntry()
|
||||
else
|
||||
{
|
||||
local_node->refname = (char *) palloc(length + 1);
|
||||
StrNCpy(local_node->refname, token, length+1);
|
||||
StrNCpy(local_node->refname, token, length + 1);
|
||||
}
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :relid */
|
||||
token = lsptok(NULL, &length); /* get :relid */
|
||||
local_node->relid = strtoul(token,NULL,10);
|
||||
local_node->relid = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :inh */
|
||||
token = lsptok(NULL, &length); /* get :inh */
|
||||
@@ -1719,7 +1719,7 @@ _readOrderKey()
|
||||
token = lsptok(NULL, &length); /* get :array_index */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
|
||||
local_node->array_index = strtoul(token,NULL,10);
|
||||
local_node->array_index = strtoul(token, NULL, 10);
|
||||
|
||||
return (local_node);
|
||||
}
|
||||
@@ -1881,7 +1881,7 @@ _readHInfo()
|
||||
token = lsptok(NULL, &length); /* get :hashop */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
|
||||
local_node->hashop = strtoul(token,NULL,10);
|
||||
local_node->hashop = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* get :jmkeys */
|
||||
local_node->jmethod.jmkeys = nodeRead(true); /* now read it */
|
||||
@@ -1969,7 +1969,7 @@ _readIter()
|
||||
* The string passed to parsePlanString must be null-terminated.
|
||||
* ----------------
|
||||
*/
|
||||
Node *
|
||||
Node *
|
||||
parsePlanString(void)
|
||||
{
|
||||
char *token;
|
||||
|
||||
Reference in New Issue
Block a user