diff options
| author | Tom Lane | 2002-12-14 00:17:59 +0000 |
|---|---|---|
| committer | Tom Lane | 2002-12-14 00:17:59 +0000 |
| commit | 2d8d66628a8ac49deba8483608135b3c358ae729 (patch) | |
| tree | 95f321c5fc2035b5110317e25b0449e85065c8a5 /src/backend/nodes | |
| parent | 29cdab3d531b6f612ab53b93dbb34a131e9cdb1c (diff) | |
Clean up plantree representation of SubPlan-s --- SubLink does not appear
in the planned representation of a subplan at all any more, only SubPlan.
This means subselect.c doesn't scribble on its input anymore, which seems
like a good thing; and there are no longer three different possible
interpretations of a SubLink. Simplify node naming and improve comments
in primnodes.h. No change to stored rules, though.
Diffstat (limited to 'src/backend/nodes')
| -rw-r--r-- | src/backend/nodes/copyfuncs.c | 19 | ||||
| -rw-r--r-- | src/backend/nodes/equalfuncs.c | 13 | ||||
| -rw-r--r-- | src/backend/nodes/outfuncs.c | 15 | ||||
| -rw-r--r-- | src/backend/nodes/readfuncs.c | 4 |
4 files changed, 27 insertions, 24 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index d84e6061246..c3abcfc9e80 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -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.232 2002/12/13 19:45:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.233 2002/12/14 00:17:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -818,21 +818,22 @@ _copySubLink(SubLink *from) } /* - * _copySubPlanExpr + * _copySubPlan */ -static SubPlanExpr * -_copySubPlanExpr(SubPlanExpr *from) +static SubPlan * +_copySubPlan(SubPlan *from) { - SubPlanExpr *newnode = makeNode(SubPlanExpr); + SubPlan *newnode = makeNode(SubPlan); - COPY_SCALAR_FIELD(typeOid); + COPY_SCALAR_FIELD(subLinkType); + COPY_SCALAR_FIELD(useor); + COPY_NODE_FIELD(oper); COPY_NODE_FIELD(plan); COPY_SCALAR_FIELD(plan_id); COPY_NODE_FIELD(rtable); COPY_INTLIST_FIELD(setParam); COPY_INTLIST_FIELD(parParam); COPY_NODE_FIELD(args); - COPY_NODE_FIELD(sublink); return newnode; } @@ -2431,8 +2432,8 @@ copyObject(void *from) case T_SubLink: retval = _copySubLink(from); break; - case T_SubPlanExpr: - retval = _copySubPlanExpr(from); + case T_SubPlan: + retval = _copySubPlan(from); break; case T_FieldSelect: retval = _copyFieldSelect(from); diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 3fc924024e2..5fc333df3de 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -18,7 +18,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.176 2002/12/12 20:35:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.177 2002/12/14 00:17:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -296,16 +296,17 @@ _equalSubLink(SubLink *a, SubLink *b) } static bool -_equalSubPlanExpr(SubPlanExpr *a, SubPlanExpr *b) +_equalSubPlan(SubPlan *a, SubPlan *b) { - COMPARE_SCALAR_FIELD(typeOid); + COMPARE_SCALAR_FIELD(subLinkType); + COMPARE_SCALAR_FIELD(useor); + COMPARE_NODE_FIELD(oper); /* should compare plans, but have to settle for comparing plan IDs */ COMPARE_SCALAR_FIELD(plan_id); COMPARE_NODE_FIELD(rtable); COMPARE_INTLIST_FIELD(setParam); COMPARE_INTLIST_FIELD(parParam); COMPARE_NODE_FIELD(args); - COMPARE_NODE_FIELD(sublink); return true; } @@ -1561,8 +1562,8 @@ equal(void *a, void *b) case T_SubLink: retval = _equalSubLink(a, b); break; - case T_SubPlanExpr: - retval = _equalSubPlanExpr(a, b); + case T_SubPlan: + retval = _equalSubPlan(a, b); break; case T_FieldSelect: retval = _equalFieldSelect(a, b); diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index a688b471e79..97fc9462a27 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.189 2002/12/13 19:45:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.190 2002/12/14 00:17:52 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -665,18 +665,19 @@ _outSubLink(StringInfo str, SubLink *node) } static void -_outSubPlanExpr(StringInfo str, SubPlanExpr *node) +_outSubPlan(StringInfo str, SubPlan *node) { - WRITE_NODE_TYPE("SUBPLANEXPR"); + WRITE_NODE_TYPE("SUBPLAN"); - WRITE_OID_FIELD(typeOid); + WRITE_ENUM_FIELD(subLinkType, SubLinkType); + WRITE_BOOL_FIELD(useor); + WRITE_NODE_FIELD(oper); WRITE_NODE_FIELD(plan); WRITE_INT_FIELD(plan_id); WRITE_NODE_FIELD(rtable); WRITE_INTLIST_FIELD(setParam); WRITE_INTLIST_FIELD(parParam); WRITE_NODE_FIELD(args); - WRITE_NODE_FIELD(sublink); } static void @@ -1498,8 +1499,8 @@ _outNode(StringInfo str, void *obj) case T_SubLink: _outSubLink(str, obj); break; - case T_SubPlanExpr: - _outSubPlanExpr(str, obj); + case T_SubPlan: + _outSubPlan(str, obj); break; case T_FieldSelect: _outFieldSelect(str, obj); diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index 54e3916ebf6..9ecd40f2e1d 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.143 2002/12/13 19:45:56 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.144 2002/12/14 00:17:54 tgl Exp $ * * NOTES * Path and Plan nodes do not have any readfuncs support, because we @@ -540,7 +540,7 @@ _readSubLink(void) } /* - * _readSubPlanExpr is not needed since it doesn't appear in stored rules. + * _readSubPlan is not needed since it doesn't appear in stored rules. */ /* |
