mirror of
https://github.com/postgres/postgres.git
synced 2025-07-23 03:21:12 +03:00
First cut at full support for OUTER JOINs. There are still a few loose
ends to clean up (see my message of same date to pghackers), but mostly it works. INITDB REQUIRED!
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.120 2000/08/11 23:45:31 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.121 2000/09/12 21:06:49 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -311,8 +311,12 @@ _copyTidScan(TidScan *from)
|
||||
static void
|
||||
CopyJoinFields(Join *from, Join *newnode)
|
||||
{
|
||||
/* nothing extra */
|
||||
return;
|
||||
newnode->jointype = from->jointype;
|
||||
Node_Copy(from, newnode, joinqual);
|
||||
/* subPlan list must point to subplans in the new subtree, not the old */
|
||||
if (from->plan.subPlan != NIL)
|
||||
newnode->plan.subPlan = nconc(newnode->plan.subPlan,
|
||||
pull_subplans((Node *) newnode->joinqual));
|
||||
}
|
||||
|
||||
|
||||
@ -381,8 +385,8 @@ _copyMergeJoin(MergeJoin *from)
|
||||
/*
|
||||
* We must add subplans in mergeclauses to the new plan's subPlan list
|
||||
*/
|
||||
if (from->join.subPlan != NIL)
|
||||
newnode->join.subPlan = nconc(newnode->join.subPlan,
|
||||
if (from->join.plan.subPlan != NIL)
|
||||
newnode->join.plan.subPlan = nconc(newnode->join.plan.subPlan,
|
||||
pull_subplans((Node *) newnode->mergeclauses));
|
||||
|
||||
return newnode;
|
||||
@ -414,8 +418,8 @@ _copyHashJoin(HashJoin *from)
|
||||
/*
|
||||
* We must add subplans in hashclauses to the new plan's subPlan list
|
||||
*/
|
||||
if (from->join.subPlan != NIL)
|
||||
newnode->join.subPlan = nconc(newnode->join.subPlan,
|
||||
if (from->join.plan.subPlan != NIL)
|
||||
newnode->join.plan.subPlan = nconc(newnode->join.plan.subPlan,
|
||||
pull_subplans((Node *) newnode->hashclauses));
|
||||
|
||||
return newnode;
|
||||
@ -510,21 +514,6 @@ _copyGroupClause(GroupClause *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static JoinExpr *
|
||||
_copyJoinExpr(JoinExpr *from)
|
||||
{
|
||||
JoinExpr *newnode = makeNode(JoinExpr);
|
||||
|
||||
newnode->jointype = from->jointype;
|
||||
newnode->isNatural = from->isNatural;
|
||||
Node_Copy(from, newnode, larg);
|
||||
Node_Copy(from, newnode, rarg);
|
||||
Node_Copy(from, newnode, alias);
|
||||
Node_Copy(from, newnode, quals);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* _copyUnique
|
||||
* ----------------
|
||||
@ -914,6 +903,34 @@ _copyRelabelType(RelabelType *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static RangeTblRef *
|
||||
_copyRangeTblRef(RangeTblRef *from)
|
||||
{
|
||||
RangeTblRef *newnode = makeNode(RangeTblRef);
|
||||
|
||||
newnode->rtindex = from->rtindex;
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static JoinExpr *
|
||||
_copyJoinExpr(JoinExpr *from)
|
||||
{
|
||||
JoinExpr *newnode = makeNode(JoinExpr);
|
||||
|
||||
newnode->jointype = from->jointype;
|
||||
newnode->isNatural = from->isNatural;
|
||||
Node_Copy(from, newnode, larg);
|
||||
Node_Copy(from, newnode, rarg);
|
||||
Node_Copy(from, newnode, using);
|
||||
Node_Copy(from, newnode, quals);
|
||||
Node_Copy(from, newnode, alias);
|
||||
Node_Copy(from, newnode, colnames);
|
||||
Node_Copy(from, newnode, colvars);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* _copyCaseExpr
|
||||
* ----------------
|
||||
@ -1014,6 +1031,7 @@ _copyRelOptInfo(RelOptInfo *from)
|
||||
|
||||
Node_Copy(from, newnode, baserestrictinfo);
|
||||
newnode->baserestrictcost = from->baserestrictcost;
|
||||
newnode->outerjoinset = listCopy(from->outerjoinset);
|
||||
Node_Copy(from, newnode, joininfo);
|
||||
Node_Copy(from, newnode, innerjoin);
|
||||
|
||||
@ -1137,6 +1155,7 @@ _copyIndexPath(IndexPath *from)
|
||||
Node_Copy(from, newnode, indexqual);
|
||||
newnode->indexscandir = from->indexscandir;
|
||||
newnode->joinrelids = listCopy(from->joinrelids);
|
||||
newnode->alljoinquals = from->alljoinquals;
|
||||
newnode->rows = from->rows;
|
||||
|
||||
return newnode;
|
||||
@ -1177,6 +1196,7 @@ _copyTidPath(TidPath *from)
|
||||
static void
|
||||
CopyJoinPathFields(JoinPath *from, JoinPath *newnode)
|
||||
{
|
||||
newnode->jointype = from->jointype;
|
||||
Node_Copy(from, newnode, outerjoinpath);
|
||||
Node_Copy(from, newnode, innerjoinpath);
|
||||
Node_Copy(from, newnode, joinrestrictinfo);
|
||||
@ -1286,6 +1306,7 @@ _copyRestrictInfo(RestrictInfo *from)
|
||||
* ----------------
|
||||
*/
|
||||
Node_Copy(from, newnode, clause);
|
||||
newnode->isjoinqual = from->isjoinqual;
|
||||
Node_Copy(from, newnode, subclauseindices);
|
||||
newnode->mergejoinoperator = from->mergejoinoperator;
|
||||
newnode->left_sortop = from->left_sortop;
|
||||
@ -1370,12 +1391,11 @@ _copyRangeTblEntry(RangeTblEntry *from)
|
||||
|
||||
if (from->relname)
|
||||
newnode->relname = pstrdup(from->relname);
|
||||
Node_Copy(from, newnode, ref);
|
||||
Node_Copy(from, newnode, eref);
|
||||
newnode->relid = from->relid;
|
||||
Node_Copy(from, newnode, alias);
|
||||
Node_Copy(from, newnode, eref);
|
||||
newnode->inh = from->inh;
|
||||
newnode->inFromCl = from->inFromCl;
|
||||
newnode->inJoinSet = from->inJoinSet;
|
||||
newnode->skipAcl = from->skipAcl;
|
||||
|
||||
return newnode;
|
||||
@ -1526,18 +1546,6 @@ _copyTypeName(TypeName *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static RelExpr *
|
||||
_copyRelExpr(RelExpr *from)
|
||||
{
|
||||
RelExpr *newnode = makeNode(RelExpr);
|
||||
|
||||
if (from->relname)
|
||||
newnode->relname = pstrdup(from->relname);
|
||||
newnode->inh = from->inh;
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static SortGroupBy *
|
||||
_copySortGroupBy(SortGroupBy *from)
|
||||
{
|
||||
@ -1555,7 +1563,20 @@ _copyRangeVar(RangeVar *from)
|
||||
{
|
||||
RangeVar *newnode = makeNode(RangeVar);
|
||||
|
||||
Node_Copy(from, newnode, relExpr);
|
||||
if (from->relname)
|
||||
newnode->relname = pstrdup(from->relname);
|
||||
newnode->inh = from->inh;
|
||||
Node_Copy(from, newnode, name);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static RangeSubselect *
|
||||
_copyRangeSubselect(RangeSubselect *from)
|
||||
{
|
||||
RangeSubselect *newnode = makeNode(RangeSubselect);
|
||||
|
||||
Node_Copy(from, newnode, subquery);
|
||||
Node_Copy(from, newnode, name);
|
||||
|
||||
return newnode;
|
||||
@ -1650,6 +1671,8 @@ _copyQuery(Query *from)
|
||||
newnode->hasSubLinks = from->hasSubLinks;
|
||||
|
||||
Node_Copy(from, newnode, rtable);
|
||||
Node_Copy(from, newnode, jointree);
|
||||
|
||||
Node_Copy(from, newnode, targetList);
|
||||
Node_Copy(from, newnode, qual);
|
||||
Node_Copy(from, newnode, rowMark);
|
||||
@ -2548,6 +2571,12 @@ copyObject(void *from)
|
||||
case T_RelabelType:
|
||||
retval = _copyRelabelType(from);
|
||||
break;
|
||||
case T_RangeTblRef:
|
||||
retval = _copyRangeTblRef(from);
|
||||
break;
|
||||
case T_JoinExpr:
|
||||
retval = _copyJoinExpr(from);
|
||||
break;
|
||||
|
||||
/*
|
||||
* RELATION NODES
|
||||
@ -2809,15 +2838,15 @@ copyObject(void *from)
|
||||
case T_TypeCast:
|
||||
retval = _copyTypeCast(from);
|
||||
break;
|
||||
case T_RelExpr:
|
||||
retval = _copyRelExpr(from);
|
||||
break;
|
||||
case T_SortGroupBy:
|
||||
retval = _copySortGroupBy(from);
|
||||
break;
|
||||
case T_RangeVar:
|
||||
retval = _copyRangeVar(from);
|
||||
break;
|
||||
case T_RangeSubselect:
|
||||
retval = _copyRangeSubselect(from);
|
||||
break;
|
||||
case T_TypeName:
|
||||
retval = _copyTypeName(from);
|
||||
break;
|
||||
@ -2845,9 +2874,6 @@ copyObject(void *from)
|
||||
case T_GroupClause:
|
||||
retval = _copyGroupClause(from);
|
||||
break;
|
||||
case T_JoinExpr:
|
||||
retval = _copyJoinExpr(from);
|
||||
break;
|
||||
case T_CaseExpr:
|
||||
retval = _copyCaseExpr(from);
|
||||
break;
|
||||
|
@ -20,7 +20,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.72 2000/08/11 23:45:31 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.73 2000/09/12 21:06:49 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -256,6 +256,26 @@ _equalSubLink(SubLink *a, SubLink *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalArrayRef(ArrayRef *a, ArrayRef *b)
|
||||
{
|
||||
if (a->refelemtype != b->refelemtype)
|
||||
return false;
|
||||
if (a->refattrlength != b->refattrlength)
|
||||
return false;
|
||||
if (a->refelemlength != b->refelemlength)
|
||||
return false;
|
||||
if (a->refelembyval != b->refelembyval)
|
||||
return false;
|
||||
if (!equal(a->refupperindexpr, b->refupperindexpr))
|
||||
return false;
|
||||
if (!equal(a->reflowerindexpr, b->reflowerindexpr))
|
||||
return false;
|
||||
if (!equal(a->refexpr, b->refexpr))
|
||||
return false;
|
||||
return equal(a->refassgnexpr, b->refassgnexpr);
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalFieldSelect(FieldSelect *a, FieldSelect *b)
|
||||
{
|
||||
@ -283,23 +303,37 @@ _equalRelabelType(RelabelType *a, RelabelType *b)
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalArrayRef(ArrayRef *a, ArrayRef *b)
|
||||
_equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
|
||||
{
|
||||
if (a->refelemtype != b->refelemtype)
|
||||
if (a->rtindex != b->rtindex)
|
||||
return false;
|
||||
if (a->refattrlength != b->refattrlength)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalJoinExpr(JoinExpr *a, JoinExpr *b)
|
||||
{
|
||||
if (a->jointype != b->jointype)
|
||||
return false;
|
||||
if (a->refelemlength != b->refelemlength)
|
||||
if (a->isNatural != b->isNatural)
|
||||
return false;
|
||||
if (a->refelembyval != b->refelembyval)
|
||||
if (!equal(a->larg, b->larg))
|
||||
return false;
|
||||
if (!equal(a->refupperindexpr, b->refupperindexpr))
|
||||
if (!equal(a->rarg, b->rarg))
|
||||
return false;
|
||||
if (!equal(a->reflowerindexpr, b->reflowerindexpr))
|
||||
if (!equal(a->using, b->using))
|
||||
return false;
|
||||
if (!equal(a->refexpr, b->refexpr))
|
||||
if (!equal(a->quals, b->quals))
|
||||
return false;
|
||||
return equal(a->refassgnexpr, b->refassgnexpr);
|
||||
if (!equal(a->alias, b->alias))
|
||||
return false;
|
||||
if (!equal(a->colnames, b->colnames))
|
||||
return false;
|
||||
if (!equal(a->colvars, b->colvars))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -370,6 +404,8 @@ _equalIndexPath(IndexPath *a, IndexPath *b)
|
||||
return false;
|
||||
if (!equali(a->joinrelids, b->joinrelids))
|
||||
return false;
|
||||
if (a->alljoinquals != b->alljoinquals)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Skip 'rows' because of possibility of floating-point roundoff
|
||||
@ -395,6 +431,8 @@ _equalJoinPath(JoinPath *a, JoinPath *b)
|
||||
{
|
||||
if (!_equalPath((Path *) a, (Path *) b))
|
||||
return false;
|
||||
if (a->jointype != b->jointype)
|
||||
return false;
|
||||
if (!equal(a->outerjoinpath, b->outerjoinpath))
|
||||
return false;
|
||||
if (!equal(a->innerjoinpath, b->innerjoinpath))
|
||||
@ -457,6 +495,8 @@ _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
|
||||
{
|
||||
if (!equal(a->clause, b->clause))
|
||||
return false;
|
||||
if (a->isjoinqual != b->isjoinqual)
|
||||
return false;
|
||||
if (!equal(a->subclauseindices, b->subclauseindices))
|
||||
return false;
|
||||
if (a->mergejoinoperator != b->mergejoinoperator)
|
||||
@ -557,6 +597,8 @@ _equalQuery(Query *a, Query *b)
|
||||
return false;
|
||||
if (!equal(a->rtable, b->rtable))
|
||||
return false;
|
||||
if (!equal(a->jointree, b->jointree))
|
||||
return false;
|
||||
if (!equal(a->targetList, b->targetList))
|
||||
return false;
|
||||
if (!equal(a->qual, b->qual))
|
||||
@ -1475,17 +1517,6 @@ _equalTypeCast(TypeCast *a, TypeCast *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalRelExpr(RelExpr *a, RelExpr *b)
|
||||
{
|
||||
if (!equalstr(a->relname, b->relname))
|
||||
return false;
|
||||
if (a->inh != b->inh)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalSortGroupBy(SortGroupBy *a, SortGroupBy *b)
|
||||
{
|
||||
@ -1500,7 +1531,20 @@ _equalSortGroupBy(SortGroupBy *a, SortGroupBy *b)
|
||||
static bool
|
||||
_equalRangeVar(RangeVar *a, RangeVar *b)
|
||||
{
|
||||
if (!equal(a->relExpr, b->relExpr))
|
||||
if (!equalstr(a->relname, b->relname))
|
||||
return false;
|
||||
if (a->inh != b->inh)
|
||||
return false;
|
||||
if (!equal(a->name, b->name))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
|
||||
{
|
||||
if (!equal(a->subquery, b->subquery))
|
||||
return false;
|
||||
if (!equal(a->name, b->name))
|
||||
return false;
|
||||
@ -1605,17 +1649,16 @@ _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
|
||||
{
|
||||
if (!equalstr(a->relname, b->relname))
|
||||
return false;
|
||||
if (!equal(a->ref, b->ref))
|
||||
return false;
|
||||
/* XXX what about eref? */
|
||||
if (a->relid != b->relid)
|
||||
return false;
|
||||
if (!equal(a->alias, b->alias))
|
||||
return false;
|
||||
if (!equal(a->eref, b->eref))
|
||||
return false;
|
||||
if (a->inh != b->inh)
|
||||
return false;
|
||||
if (a->inFromCl != b->inFromCl)
|
||||
return false;
|
||||
if (a->inJoinSet != b->inJoinSet)
|
||||
return false;
|
||||
if (a->skipAcl != b->skipAcl)
|
||||
return false;
|
||||
|
||||
@ -1644,25 +1687,6 @@ _equalRowMark(RowMark *a, RowMark *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalJoinExpr(JoinExpr *a, JoinExpr *b)
|
||||
{
|
||||
if (a->jointype != b->jointype)
|
||||
return false;
|
||||
if (a->isNatural != b->isNatural)
|
||||
return false;
|
||||
if (!equal(a->larg, b->larg))
|
||||
return false;
|
||||
if (!equal(a->rarg, b->rarg))
|
||||
return false;
|
||||
if (!equal(a->alias, b->alias))
|
||||
return false;
|
||||
if (!equal(a->quals, b->quals))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalFkConstraint(FkConstraint *a, FkConstraint *b)
|
||||
{
|
||||
@ -1808,6 +1832,12 @@ equal(void *a, void *b)
|
||||
case T_RelabelType:
|
||||
retval = _equalRelabelType(a, b);
|
||||
break;
|
||||
case T_RangeTblRef:
|
||||
retval = _equalRangeTblRef(a, b);
|
||||
break;
|
||||
case T_JoinExpr:
|
||||
retval = _equalJoinExpr(a, b);
|
||||
break;
|
||||
|
||||
case T_RelOptInfo:
|
||||
retval = _equalRelOptInfo(a, b);
|
||||
@ -2067,15 +2097,15 @@ equal(void *a, void *b)
|
||||
case T_TypeCast:
|
||||
retval = _equalTypeCast(a, b);
|
||||
break;
|
||||
case T_RelExpr:
|
||||
retval = _equalRelExpr(a, b);
|
||||
break;
|
||||
case T_SortGroupBy:
|
||||
retval = _equalSortGroupBy(a, b);
|
||||
break;
|
||||
case T_RangeVar:
|
||||
retval = _equalRangeVar(a, b);
|
||||
break;
|
||||
case T_RangeSubselect:
|
||||
retval = _equalRangeSubselect(a, b);
|
||||
break;
|
||||
case T_TypeName:
|
||||
retval = _equalTypeName(a, b);
|
||||
break;
|
||||
@ -2104,9 +2134,6 @@ equal(void *a, void *b)
|
||||
/* GroupClause is equivalent to SortClause */
|
||||
retval = _equalSortClause(a, b);
|
||||
break;
|
||||
case T_JoinExpr:
|
||||
retval = _equalJoinExpr(a, b);
|
||||
break;
|
||||
case T_CaseExpr:
|
||||
retval = _equalCaseExpr(a, b);
|
||||
break;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.32 2000/06/09 01:44:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.33 2000/09/12 21:06:49 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* XXX a few of the following functions are duplicated to handle
|
||||
@ -351,6 +351,25 @@ member(void *l1, List *l2)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* like member(), but use when pointer-equality comparison is sufficient
|
||||
*/
|
||||
bool
|
||||
ptrMember(void *l1, List *l2)
|
||||
{
|
||||
List *i;
|
||||
|
||||
foreach(i, l2)
|
||||
{
|
||||
if (l1 == ((void *) lfirst(i)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* membership test for integer lists
|
||||
*/
|
||||
bool
|
||||
intMember(int l1, List *l2)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.125 2000/08/08 15:41:26 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.126 2000/09/12 21:06:49 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@ -268,6 +268,9 @@ _outQuery(StringInfo str, Query *node)
|
||||
appendStringInfo(str, " :rtable ");
|
||||
_outNode(str, node->rtable);
|
||||
|
||||
appendStringInfo(str, " :jointree ");
|
||||
_outNode(str, node->jointree);
|
||||
|
||||
appendStringInfo(str, " :targetlist ");
|
||||
_outNode(str, node->targetList);
|
||||
|
||||
@ -389,7 +392,6 @@ _outAppend(StringInfo str, Append *node)
|
||||
" :inheritrelid %u :inheritrtable ",
|
||||
node->inheritrelid);
|
||||
_outNode(str, node->inheritrtable);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -400,7 +402,9 @@ _outJoin(StringInfo str, Join *node)
|
||||
{
|
||||
appendStringInfo(str, " JOIN ");
|
||||
_outPlanInfo(str, (Plan *) node);
|
||||
|
||||
appendStringInfo(str, " :jointype %d :joinqual ",
|
||||
(int) node->jointype);
|
||||
_outNode(str, node->joinqual);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -411,6 +415,9 @@ _outNestLoop(StringInfo str, NestLoop *node)
|
||||
{
|
||||
appendStringInfo(str, " NESTLOOP ");
|
||||
_outPlanInfo(str, (Plan *) node);
|
||||
appendStringInfo(str, " :jointype %d :joinqual ",
|
||||
(int) node->join.jointype);
|
||||
_outNode(str, node->join.joinqual);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -421,6 +428,9 @@ _outMergeJoin(StringInfo str, MergeJoin *node)
|
||||
{
|
||||
appendStringInfo(str, " MERGEJOIN ");
|
||||
_outPlanInfo(str, (Plan *) node);
|
||||
appendStringInfo(str, " :jointype %d :joinqual ",
|
||||
(int) node->join.jointype);
|
||||
_outNode(str, node->join.joinqual);
|
||||
|
||||
appendStringInfo(str, " :mergeclauses ");
|
||||
_outNode(str, node->mergeclauses);
|
||||
@ -434,17 +444,14 @@ _outHashJoin(StringInfo str, HashJoin *node)
|
||||
{
|
||||
appendStringInfo(str, " HASHJOIN ");
|
||||
_outPlanInfo(str, (Plan *) node);
|
||||
appendStringInfo(str, " :jointype %d :joinqual ",
|
||||
(int) node->join.jointype);
|
||||
_outNode(str, node->join.joinqual);
|
||||
|
||||
appendStringInfo(str, " :hashclauses ");
|
||||
_outNode(str, node->hashclauses);
|
||||
|
||||
appendStringInfo(str,
|
||||
" :hashjoinop %u ",
|
||||
appendStringInfo(str, " :hashjoinop %u ",
|
||||
node->hashjoinop);
|
||||
|
||||
appendStringInfo(str,
|
||||
" :hashdone %d ",
|
||||
node->hashdone);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -757,32 +764,6 @@ _outSubLink(StringInfo str, SubLink *node)
|
||||
_outNode(str, node->subselect);
|
||||
}
|
||||
|
||||
/*
|
||||
* FieldSelect
|
||||
*/
|
||||
static void
|
||||
_outFieldSelect(StringInfo str, FieldSelect *node)
|
||||
{
|
||||
appendStringInfo(str, " FIELDSELECT :arg ");
|
||||
_outNode(str, node->arg);
|
||||
|
||||
appendStringInfo(str, " :fieldnum %d :resulttype %u :resulttypmod %d ",
|
||||
node->fieldnum, node->resulttype, node->resulttypmod);
|
||||
}
|
||||
|
||||
/*
|
||||
* RelabelType
|
||||
*/
|
||||
static void
|
||||
_outRelabelType(StringInfo str, RelabelType *node)
|
||||
{
|
||||
appendStringInfo(str, " RELABELTYPE :arg ");
|
||||
_outNode(str, node->arg);
|
||||
|
||||
appendStringInfo(str, " :resulttype %u :resulttypmod %d ",
|
||||
node->resulttype, node->resulttypmod);
|
||||
}
|
||||
|
||||
/*
|
||||
* ArrayRef is a subclass of Expr
|
||||
*/
|
||||
@ -846,6 +827,66 @@ _outParam(StringInfo str, Param *node)
|
||||
appendStringInfo(str, " :paramtype %u ", node->paramtype);
|
||||
}
|
||||
|
||||
/*
|
||||
* FieldSelect
|
||||
*/
|
||||
static void
|
||||
_outFieldSelect(StringInfo str, FieldSelect *node)
|
||||
{
|
||||
appendStringInfo(str, " FIELDSELECT :arg ");
|
||||
_outNode(str, node->arg);
|
||||
|
||||
appendStringInfo(str, " :fieldnum %d :resulttype %u :resulttypmod %d ",
|
||||
node->fieldnum, node->resulttype, node->resulttypmod);
|
||||
}
|
||||
|
||||
/*
|
||||
* RelabelType
|
||||
*/
|
||||
static void
|
||||
_outRelabelType(StringInfo str, RelabelType *node)
|
||||
{
|
||||
appendStringInfo(str, " RELABELTYPE :arg ");
|
||||
_outNode(str, node->arg);
|
||||
|
||||
appendStringInfo(str, " :resulttype %u :resulttypmod %d ",
|
||||
node->resulttype, node->resulttypmod);
|
||||
}
|
||||
|
||||
/*
|
||||
* RangeTblRef
|
||||
*/
|
||||
static void
|
||||
_outRangeTblRef(StringInfo str, RangeTblRef *node)
|
||||
{
|
||||
appendStringInfo(str, " RANGETBLREF %d ",
|
||||
node->rtindex);
|
||||
}
|
||||
|
||||
/*
|
||||
* JoinExpr
|
||||
*/
|
||||
static void
|
||||
_outJoinExpr(StringInfo str, JoinExpr *node)
|
||||
{
|
||||
appendStringInfo(str, " JOINEXPR :jointype %d :isNatural %s :larg ",
|
||||
(int) node->jointype,
|
||||
node->isNatural ? "true" : "false");
|
||||
_outNode(str, node->larg);
|
||||
appendStringInfo(str, " :rarg ");
|
||||
_outNode(str, node->rarg);
|
||||
appendStringInfo(str, " :using ");
|
||||
_outNode(str, node->using);
|
||||
appendStringInfo(str, " :quals ");
|
||||
_outNode(str, node->quals);
|
||||
appendStringInfo(str, " :alias ");
|
||||
_outNode(str, node->alias);
|
||||
appendStringInfo(str, " :colnames ");
|
||||
_outNode(str, node->colnames);
|
||||
appendStringInfo(str, " :colvars ");
|
||||
_outNode(str, node->colvars);
|
||||
}
|
||||
|
||||
/*
|
||||
* Stuff from execnodes.h
|
||||
*/
|
||||
@ -897,6 +938,11 @@ _outRelOptInfo(StringInfo str, RelOptInfo *node)
|
||||
node->pruneable ? "true" : "false");
|
||||
_outNode(str, node->baserestrictinfo);
|
||||
|
||||
appendStringInfo(str,
|
||||
" :baserestrictcost %.2f :outerjoinset ",
|
||||
node->baserestrictcost);
|
||||
_outIntList(str, node->outerjoinset);
|
||||
|
||||
appendStringInfo(str, " :joininfo ");
|
||||
_outNode(str, node->joininfo);
|
||||
|
||||
@ -931,14 +977,14 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
|
||||
{
|
||||
appendStringInfo(str, " RTE :relname ");
|
||||
_outToken(str, node->relname);
|
||||
appendStringInfo(str, " :ref ");
|
||||
_outNode(str, node->ref);
|
||||
appendStringInfo(str,
|
||||
" :relid %u :inh %s :inFromCl %s :inJoinSet %s :skipAcl %s",
|
||||
node->relid,
|
||||
appendStringInfo(str, " :relid %u :alias ",
|
||||
node->relid);
|
||||
_outNode(str, node->alias);
|
||||
appendStringInfo(str, " :eref ");
|
||||
_outNode(str, node->eref);
|
||||
appendStringInfo(str, " :inh %s :inFromCl %s :skipAcl %s",
|
||||
node->inh ? "true" : "false",
|
||||
node->inFromCl ? "true" : "false",
|
||||
node->inJoinSet ? "true" : "false",
|
||||
node->skipAcl ? "true" : "false");
|
||||
}
|
||||
|
||||
@ -985,7 +1031,8 @@ _outIndexPath(StringInfo str, IndexPath *node)
|
||||
(int) node->indexscandir);
|
||||
_outIntList(str, node->joinrelids);
|
||||
|
||||
appendStringInfo(str, " :rows %.2f ",
|
||||
appendStringInfo(str, " :alljoinquals %s :rows %.2f ",
|
||||
node->alljoinquals ? "true" : "false",
|
||||
node->rows);
|
||||
}
|
||||
|
||||
@ -1021,7 +1068,8 @@ _outNestPath(StringInfo str, NestPath *node)
|
||||
node->path.startup_cost,
|
||||
node->path.total_cost);
|
||||
_outNode(str, node->path.pathkeys);
|
||||
appendStringInfo(str, " :outerjoinpath ");
|
||||
appendStringInfo(str, " :jointype %d :outerjoinpath ",
|
||||
(int) node->jointype);
|
||||
_outNode(str, node->outerjoinpath);
|
||||
appendStringInfo(str, " :innerjoinpath ");
|
||||
_outNode(str, node->innerjoinpath);
|
||||
@ -1041,7 +1089,8 @@ _outMergePath(StringInfo str, MergePath *node)
|
||||
node->jpath.path.startup_cost,
|
||||
node->jpath.path.total_cost);
|
||||
_outNode(str, node->jpath.path.pathkeys);
|
||||
appendStringInfo(str, " :outerjoinpath ");
|
||||
appendStringInfo(str, " :jointype %d :outerjoinpath ",
|
||||
(int) node->jpath.jointype);
|
||||
_outNode(str, node->jpath.outerjoinpath);
|
||||
appendStringInfo(str, " :innerjoinpath ");
|
||||
_outNode(str, node->jpath.innerjoinpath);
|
||||
@ -1070,7 +1119,8 @@ _outHashPath(StringInfo str, HashPath *node)
|
||||
node->jpath.path.startup_cost,
|
||||
node->jpath.path.total_cost);
|
||||
_outNode(str, node->jpath.path.pathkeys);
|
||||
appendStringInfo(str, " :outerjoinpath ");
|
||||
appendStringInfo(str, " :jointype %d :outerjoinpath ",
|
||||
(int) node->jpath.jointype);
|
||||
_outNode(str, node->jpath.outerjoinpath);
|
||||
appendStringInfo(str, " :innerjoinpath ");
|
||||
_outNode(str, node->jpath.innerjoinpath);
|
||||
@ -1101,7 +1151,8 @@ _outRestrictInfo(StringInfo str, RestrictInfo *node)
|
||||
appendStringInfo(str, " RESTRICTINFO :clause ");
|
||||
_outNode(str, node->clause);
|
||||
|
||||
appendStringInfo(str, " :subclauseindices ");
|
||||
appendStringInfo(str, " :isjoinqual %s :subclauseindices ",
|
||||
node->isjoinqual ? "true" : "false");
|
||||
_outNode(str, node->subclauseindices);
|
||||
|
||||
appendStringInfo(str, " :mergejoinoperator %u ", node->mergejoinoperator);
|
||||
@ -1483,12 +1534,6 @@ _outNode(StringInfo str, void *obj)
|
||||
case T_SubLink:
|
||||
_outSubLink(str, obj);
|
||||
break;
|
||||
case T_FieldSelect:
|
||||
_outFieldSelect(str, obj);
|
||||
break;
|
||||
case T_RelabelType:
|
||||
_outRelabelType(str, obj);
|
||||
break;
|
||||
case T_ArrayRef:
|
||||
_outArrayRef(str, obj);
|
||||
break;
|
||||
@ -1501,6 +1546,18 @@ _outNode(StringInfo str, void *obj)
|
||||
case T_Param:
|
||||
_outParam(str, obj);
|
||||
break;
|
||||
case T_FieldSelect:
|
||||
_outFieldSelect(str, obj);
|
||||
break;
|
||||
case T_RelabelType:
|
||||
_outRelabelType(str, obj);
|
||||
break;
|
||||
case T_RangeTblRef:
|
||||
_outRangeTblRef(str, obj);
|
||||
break;
|
||||
case T_JoinExpr:
|
||||
_outJoinExpr(str, obj);
|
||||
break;
|
||||
case T_EState:
|
||||
_outEState(str, obj);
|
||||
break;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.39 2000/06/18 22:44:05 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.40 2000/09/12 21:06:49 tgl Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@ -133,7 +133,7 @@ print_rt(List *rtable)
|
||||
RangeTblEntry *rte = lfirst(l);
|
||||
|
||||
printf("%d\t%s(%s)\t%u\t%d\t%s\n",
|
||||
i, rte->relname, rte->ref->relname, rte->relid,
|
||||
i, rte->relname, rte->eref->relname, rte->relid,
|
||||
rte->inFromCl,
|
||||
(rte->inh ? "inh" : ""));
|
||||
i++;
|
||||
@ -157,7 +157,6 @@ print_expr(Node *expr, List *rtable)
|
||||
if (IsA(expr, Var))
|
||||
{
|
||||
Var *var = (Var *) expr;
|
||||
RangeTblEntry *rt;
|
||||
char *relname,
|
||||
*attname;
|
||||
|
||||
@ -173,10 +172,10 @@ print_expr(Node *expr, List *rtable)
|
||||
break;
|
||||
default:
|
||||
{
|
||||
RangeTblEntry *rt;
|
||||
|
||||
rt = rt_fetch(var->varno, rtable);
|
||||
relname = rt->relname;
|
||||
if (rt->ref && rt->ref->relname)
|
||||
relname = rt->ref->relname; /* table renamed */
|
||||
relname = rt->eref->relname;
|
||||
attname = get_attname(rt->relid, var->varattno);
|
||||
}
|
||||
break;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.95 2000/08/08 15:41:27 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.96 2000/09/12 21:06:49 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||
@ -119,6 +119,9 @@ _readQuery()
|
||||
token = lsptok(NULL, &length); /* skip :rtable */
|
||||
local_node->rtable = nodeRead(true);
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :jointree */
|
||||
local_node->jointree = nodeRead(true);
|
||||
|
||||
token = lsptok(NULL, &length); /* skip :targetlist */
|
||||
local_node->targetList = nodeRead(true);
|
||||
|
||||
@ -335,14 +338,22 @@ _readAppend()
|
||||
|
||||
/* ----------------
|
||||
* _getJoin
|
||||
*
|
||||
* In case Join is not the same structure as Plan someday.
|
||||
* ----------------
|
||||
*/
|
||||
static void
|
||||
_getJoin(Join *node)
|
||||
{
|
||||
char *token;
|
||||
int length;
|
||||
|
||||
_getPlan((Plan *) node);
|
||||
|
||||
token = lsptok(NULL, &length); /* skip the :jointype */
|
||||
token = lsptok(NULL, &length); /* get the jointype */
|
||||
node->jointype = (JoinType) atoi(token);
|
||||
|
||||
token = lsptok(NULL, &length); /* skip the :joinqual */
|
||||
node->joinqual = nodeRead(true); /* get the joinqual */
|
||||
}
|
||||
|
||||
|
||||
@ -399,6 +410,7 @@ _readMergeJoin()
|
||||
local_node = makeNode(MergeJoin);
|
||||
|
||||
_getJoin((Join *) local_node);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :mergeclauses */
|
||||
local_node->mergeclauses = nodeRead(true); /* now read it */
|
||||
|
||||
@ -429,19 +441,13 @@ _readHashJoin()
|
||||
token = lsptok(NULL, &length); /* get hashjoinop */
|
||||
local_node->hashjoinop = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :hashdone */
|
||||
token = lsptok(NULL, &length); /* eat hashdone */
|
||||
local_node->hashdone = false;
|
||||
|
||||
return local_node;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* _getScan
|
||||
*
|
||||
* Scan is a subclass of Node
|
||||
* (Actually, according to the plannodes.h include file, it is a
|
||||
* subclass of Plan. This is why _getPlan is used here.)
|
||||
* Scan is a subclass of Plan.
|
||||
*
|
||||
* Scan gets its own get function since stuff inherits it.
|
||||
* ----------------
|
||||
@ -462,7 +468,7 @@ _getScan(Scan *node)
|
||||
/* ----------------
|
||||
* _readScan
|
||||
*
|
||||
* Scan is a subclass of Plan (Not Node, see above).
|
||||
* Scan is a subclass of Plan.
|
||||
* ----------------
|
||||
*/
|
||||
static Scan *
|
||||
@ -1154,6 +1160,74 @@ _readRelabelType()
|
||||
return local_node;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* _readRangeTblRef
|
||||
*
|
||||
* RangeTblRef is a subclass of Node
|
||||
* ----------------
|
||||
*/
|
||||
static RangeTblRef *
|
||||
_readRangeTblRef()
|
||||
{
|
||||
RangeTblRef *local_node;
|
||||
char *token;
|
||||
int length;
|
||||
|
||||
local_node = makeNode(RangeTblRef);
|
||||
|
||||
token = lsptok(NULL, &length); /* get rtindex */
|
||||
local_node->rtindex = atoi(token);
|
||||
|
||||
return local_node;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* _readJoinExpr
|
||||
*
|
||||
* JoinExpr is a subclass of Node
|
||||
* ----------------
|
||||
*/
|
||||
static JoinExpr *
|
||||
_readJoinExpr()
|
||||
{
|
||||
JoinExpr *local_node;
|
||||
char *token;
|
||||
int length;
|
||||
|
||||
local_node = makeNode(JoinExpr);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :jointype */
|
||||
token = lsptok(NULL, &length); /* get jointype */
|
||||
local_node->jointype = (JoinType) atoi(token);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :isNatural */
|
||||
token = lsptok(NULL, &length); /* get :isNatural */
|
||||
local_node->isNatural = (token[0] == 't') ? true : false;
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :larg */
|
||||
local_node->larg = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :rarg */
|
||||
local_node->rarg = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :using */
|
||||
local_node->using = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :quals */
|
||||
local_node->quals = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :alias */
|
||||
local_node->alias = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :colnames */
|
||||
local_node->colnames = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :colvars */
|
||||
local_node->colvars = nodeRead(true); /* now read it */
|
||||
|
||||
return local_node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Stuff from execnodes.h
|
||||
*/
|
||||
@ -1252,7 +1326,14 @@ _readRelOptInfo()
|
||||
local_node->pruneable = (token[0] == 't') ? true : false;
|
||||
|
||||
token = lsptok(NULL, &length); /* get :baserestrictinfo */
|
||||
local_node->baserestrictinfo = nodeRead(true); /* now read it */
|
||||
local_node->baserestrictinfo = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :baserestrictcost */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
local_node->baserestrictcost = (Cost) atof(token);
|
||||
|
||||
token = lsptok(NULL, &length); /* get :outerjoinset */
|
||||
local_node->outerjoinset = toIntList(nodeRead(true)); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :joininfo */
|
||||
local_node->joininfo = nodeRead(true); /* now read it */
|
||||
@ -1324,13 +1405,16 @@ _readRangeTblEntry()
|
||||
else
|
||||
local_node->relname = debackslash(token, length);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :ref */
|
||||
local_node->ref = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :relid */
|
||||
token = lsptok(NULL, &length); /* get :relid */
|
||||
local_node->relid = strtoul(token, NULL, 10);
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :alias */
|
||||
local_node->alias = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :eref */
|
||||
local_node->eref = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :inh */
|
||||
token = lsptok(NULL, &length); /* get :inh */
|
||||
local_node->inh = (token[0] == 't') ? true : false;
|
||||
@ -1339,10 +1423,6 @@ _readRangeTblEntry()
|
||||
token = lsptok(NULL, &length); /* get :inFromCl */
|
||||
local_node->inFromCl = (token[0] == 't') ? true : false;
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :inJoinSet */
|
||||
token = lsptok(NULL, &length); /* get :inJoinSet */
|
||||
local_node->inJoinSet = (token[0] == 't') ? true : false;
|
||||
|
||||
token = lsptok(NULL, &length); /* eat :skipAcl */
|
||||
token = lsptok(NULL, &length); /* get :skipAcl */
|
||||
local_node->skipAcl = (token[0] == 't') ? true : false;
|
||||
@ -1444,6 +1524,10 @@ _readIndexPath()
|
||||
token = lsptok(NULL, &length); /* get :joinrelids */
|
||||
local_node->joinrelids = toIntList(nodeRead(true));
|
||||
|
||||
token = lsptok(NULL, &length); /* get :alljoinquals */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
local_node->alljoinquals = (token[0] == 't') ? true : false;
|
||||
|
||||
token = lsptok(NULL, &length); /* get :rows */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
local_node->rows = atof(token);
|
||||
@ -1520,6 +1604,10 @@ _readNestPath()
|
||||
token = lsptok(NULL, &length); /* get :pathkeys */
|
||||
local_node->path.pathkeys = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :jointype */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
local_node->jointype = (JoinType) atoi(token);
|
||||
|
||||
token = lsptok(NULL, &length); /* get :outerjoinpath */
|
||||
local_node->outerjoinpath = nodeRead(true); /* now read it */
|
||||
|
||||
@ -1527,7 +1615,7 @@ _readNestPath()
|
||||
local_node->innerjoinpath = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :joinrestrictinfo */
|
||||
local_node->joinrestrictinfo = nodeRead(true); /* now read it */
|
||||
local_node->joinrestrictinfo = nodeRead(true); /* now read it */
|
||||
|
||||
return local_node;
|
||||
}
|
||||
@ -1562,6 +1650,10 @@ _readMergePath()
|
||||
token = lsptok(NULL, &length); /* get :pathkeys */
|
||||
local_node->jpath.path.pathkeys = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :jointype */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
local_node->jpath.jointype = (JoinType) atoi(token);
|
||||
|
||||
token = lsptok(NULL, &length); /* get :outerjoinpath */
|
||||
local_node->jpath.outerjoinpath = nodeRead(true); /* now read it */
|
||||
|
||||
@ -1569,7 +1661,7 @@ _readMergePath()
|
||||
local_node->jpath.innerjoinpath = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :joinrestrictinfo */
|
||||
local_node->jpath.joinrestrictinfo = nodeRead(true); /* now read it */
|
||||
local_node->jpath.joinrestrictinfo = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :path_mergeclauses */
|
||||
local_node->path_mergeclauses = nodeRead(true); /* now read it */
|
||||
@ -1613,6 +1705,10 @@ _readHashPath()
|
||||
token = lsptok(NULL, &length); /* get :pathkeys */
|
||||
local_node->jpath.path.pathkeys = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :jointype */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
local_node->jpath.jointype = (JoinType) atoi(token);
|
||||
|
||||
token = lsptok(NULL, &length); /* get :outerjoinpath */
|
||||
local_node->jpath.outerjoinpath = nodeRead(true); /* now read it */
|
||||
|
||||
@ -1620,7 +1716,7 @@ _readHashPath()
|
||||
local_node->jpath.innerjoinpath = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :joinrestrictinfo */
|
||||
local_node->jpath.joinrestrictinfo = nodeRead(true); /* now read it */
|
||||
local_node->jpath.joinrestrictinfo = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :path_hashclauses */
|
||||
local_node->path_hashclauses = nodeRead(true); /* now read it */
|
||||
@ -1672,6 +1768,10 @@ _readRestrictInfo()
|
||||
token = lsptok(NULL, &length); /* get :clause */
|
||||
local_node->clause = nodeRead(true); /* now read it */
|
||||
|
||||
token = lsptok(NULL, &length); /* get :isjoinqual */
|
||||
token = lsptok(NULL, &length); /* now read it */
|
||||
local_node->isjoinqual = (token[0] == 't') ? true : false;
|
||||
|
||||
token = lsptok(NULL, &length); /* get :subclauseindices */
|
||||
local_node->subclauseindices = nodeRead(true); /* now read it */
|
||||
|
||||
@ -1789,6 +1889,10 @@ parsePlanString(void)
|
||||
return_value = _readFieldSelect();
|
||||
else if (length == 11 && strncmp(token, "RELABELTYPE", length) == 0)
|
||||
return_value = _readRelabelType();
|
||||
else if (length == 11 && strncmp(token, "RANGETBLREF", length) == 0)
|
||||
return_value = _readRangeTblRef();
|
||||
else if (length == 8 && strncmp(token, "JOINEXPR", length) == 0)
|
||||
return_value = _readJoinExpr();
|
||||
else if (length == 3 && strncmp(token, "AGG", length) == 0)
|
||||
return_value = _readAgg();
|
||||
else if (length == 4 && strncmp(token, "HASH", length) == 0)
|
||||
|
Reference in New Issue
Block a user