1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

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.
This commit is contained in:
Tom Lane
2002-12-14 00:17:59 +00:00
parent 29cdab3d53
commit 2d8d66628a
24 changed files with 355 additions and 356 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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.
*/
/*