mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Further tweaking of parsetree & plantree representation of SubLinks.
Simplify SubLink by storing just a List of operator OIDs, instead of a list of incomplete OpExprs --- that was a bizarre and bulky choice, with no redeeming social value since we have to build new OpExprs anyway when forming the plan tree.
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.234 2003/01/09 20:50:50 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.235 2003/01/10 21:08:10 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -809,10 +809,10 @@ _copySubLink(SubLink *from)
|
||||
SubLink *newnode = makeNode(SubLink);
|
||||
|
||||
COPY_SCALAR_FIELD(subLinkType);
|
||||
COPY_SCALAR_FIELD(operIsEquals);
|
||||
COPY_SCALAR_FIELD(useOr);
|
||||
COPY_NODE_FIELD(lefthand);
|
||||
COPY_NODE_FIELD(oper);
|
||||
COPY_NODE_FIELD(operName);
|
||||
COPY_INTLIST_FIELD(operOids);
|
||||
COPY_NODE_FIELD(subselect);
|
||||
|
||||
return newnode;
|
||||
@@ -828,10 +828,13 @@ _copySubPlan(SubPlan *from)
|
||||
|
||||
COPY_SCALAR_FIELD(subLinkType);
|
||||
COPY_SCALAR_FIELD(useOr);
|
||||
COPY_NODE_FIELD(oper);
|
||||
COPY_NODE_FIELD(exprs);
|
||||
COPY_INTLIST_FIELD(paramIds);
|
||||
COPY_NODE_FIELD(plan);
|
||||
COPY_SCALAR_FIELD(plan_id);
|
||||
COPY_NODE_FIELD(rtable);
|
||||
COPY_SCALAR_FIELD(useHashTable);
|
||||
COPY_SCALAR_FIELD(unknownEqFalse);
|
||||
COPY_INTLIST_FIELD(setParam);
|
||||
COPY_INTLIST_FIELD(parParam);
|
||||
COPY_NODE_FIELD(args);
|
||||
|
||||
@@ -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.178 2003/01/09 20:50:50 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.179 2003/01/10 21:08:10 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -287,10 +287,10 @@ static bool
|
||||
_equalSubLink(SubLink *a, SubLink *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(subLinkType);
|
||||
COMPARE_SCALAR_FIELD(operIsEquals);
|
||||
COMPARE_SCALAR_FIELD(useOr);
|
||||
COMPARE_NODE_FIELD(lefthand);
|
||||
COMPARE_NODE_FIELD(oper);
|
||||
COMPARE_NODE_FIELD(operName);
|
||||
COMPARE_INTLIST_FIELD(operOids);
|
||||
COMPARE_NODE_FIELD(subselect);
|
||||
|
||||
return true;
|
||||
@@ -301,10 +301,13 @@ _equalSubPlan(SubPlan *a, SubPlan *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(subLinkType);
|
||||
COMPARE_SCALAR_FIELD(useOr);
|
||||
COMPARE_NODE_FIELD(oper);
|
||||
COMPARE_NODE_FIELD(exprs);
|
||||
COMPARE_INTLIST_FIELD(paramIds);
|
||||
/* should compare plans, but have to settle for comparing plan IDs */
|
||||
COMPARE_SCALAR_FIELD(plan_id);
|
||||
COMPARE_NODE_FIELD(rtable);
|
||||
COMPARE_SCALAR_FIELD(useHashTable);
|
||||
COMPARE_SCALAR_FIELD(unknownEqFalse);
|
||||
COMPARE_INTLIST_FIELD(setParam);
|
||||
COMPARE_INTLIST_FIELD(parParam);
|
||||
COMPARE_NODE_FIELD(args);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.191 2003/01/09 20:50:50 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.192 2003/01/10 21:08:11 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every node type that can appear in stored rules' parsetrees *must*
|
||||
@@ -658,10 +658,10 @@ _outSubLink(StringInfo str, SubLink *node)
|
||||
WRITE_NODE_TYPE("SUBLINK");
|
||||
|
||||
WRITE_ENUM_FIELD(subLinkType, SubLinkType);
|
||||
WRITE_BOOL_FIELD(operIsEquals);
|
||||
WRITE_BOOL_FIELD(useOr);
|
||||
WRITE_NODE_FIELD(lefthand);
|
||||
WRITE_NODE_FIELD(oper);
|
||||
WRITE_NODE_FIELD(operName);
|
||||
WRITE_INTLIST_FIELD(operOids);
|
||||
WRITE_NODE_FIELD(subselect);
|
||||
}
|
||||
|
||||
@@ -672,10 +672,13 @@ _outSubPlan(StringInfo str, SubPlan *node)
|
||||
|
||||
WRITE_ENUM_FIELD(subLinkType, SubLinkType);
|
||||
WRITE_BOOL_FIELD(useOr);
|
||||
WRITE_NODE_FIELD(oper);
|
||||
WRITE_NODE_FIELD(exprs);
|
||||
WRITE_INTLIST_FIELD(paramIds);
|
||||
WRITE_NODE_FIELD(plan);
|
||||
WRITE_INT_FIELD(plan_id);
|
||||
WRITE_NODE_FIELD(rtable);
|
||||
WRITE_BOOL_FIELD(useHashTable);
|
||||
WRITE_BOOL_FIELD(unknownEqFalse);
|
||||
WRITE_INTLIST_FIELD(setParam);
|
||||
WRITE_INTLIST_FIELD(parParam);
|
||||
WRITE_NODE_FIELD(args);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.145 2003/01/09 20:50:51 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.146 2003/01/10 21:08:11 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Path and Plan nodes do not have any readfuncs support, because we
|
||||
@@ -531,10 +531,10 @@ _readSubLink(void)
|
||||
READ_LOCALS(SubLink);
|
||||
|
||||
READ_ENUM_FIELD(subLinkType, SubLinkType);
|
||||
READ_BOOL_FIELD(operIsEquals);
|
||||
READ_BOOL_FIELD(useOr);
|
||||
READ_NODE_FIELD(lefthand);
|
||||
READ_NODE_FIELD(oper);
|
||||
READ_NODE_FIELD(operName);
|
||||
READ_INTLIST_FIELD(operOids);
|
||||
READ_NODE_FIELD(subselect);
|
||||
|
||||
READ_DONE();
|
||||
|
||||
Reference in New Issue
Block a user