aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/outfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-02-19 07:03:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-02-19 07:03:34 +0000
commit7c5e5439d2a64ee82d54be2e064a4bb4602bad30 (patch)
treeda8d85b50e284413823da3bc98975c03278cb582 /src/backend/nodes/outfuncs.c
parent90c301aaa9377d385d00d93462f3f656ada8981e (diff)
downloadpostgresql-7c5e5439d2a64ee82d54be2e064a4bb4602bad30.tar.gz
postgresql-7c5e5439d2a64ee82d54be2e064a4bb4602bad30.zip
Get rid of some old and crufty global variables in the planner. When
this code was last gone over, there wasn't really any alternative to globals because we didn't have the PlannerInfo struct being passed all through the planner code. Now that we do, we can restructure things to avoid non-reentrancy. I'm fooling with this because otherwise I'd have had to add another global variable for the planned compact range table list.
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r--src/backend/nodes/outfuncs.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index a173cf59dff..0600f63b556 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.298 2007/02/19 02:23:12 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.299 2007/02/19 07:03:27 tgl Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
@@ -1226,13 +1226,26 @@ _outHashPath(StringInfo str, HashPath *node)
}
static void
+_outPlannerGlobal(StringInfo str, PlannerGlobal *node)
+{
+ WRITE_NODE_TYPE("PLANNERGLOBAL");
+
+ /* NB: this isn't a complete set of fields */
+ WRITE_NODE_FIELD(paramlist);
+ WRITE_INT_FIELD(next_plan_id);
+}
+
+static void
_outPlannerInfo(StringInfo str, PlannerInfo *node)
{
WRITE_NODE_TYPE("PLANNERINFO");
/* NB: this isn't a complete set of fields */
WRITE_NODE_FIELD(parse);
+ WRITE_NODE_FIELD(glob);
+ WRITE_UINT_FIELD(query_level);
WRITE_NODE_FIELD(join_rel_list);
+ WRITE_NODE_FIELD(init_plans);
WRITE_NODE_FIELD(eq_classes);
WRITE_NODE_FIELD(canon_pathkeys);
WRITE_NODE_FIELD(left_join_clauses);
@@ -1416,6 +1429,15 @@ _outAppendRelInfo(StringInfo str, AppendRelInfo *node)
WRITE_OID_FIELD(parent_reloid);
}
+static void
+_outPlannerParamItem(StringInfo str, PlannerParamItem *node)
+{
+ WRITE_NODE_TYPE("PLANNERPARAMITEM");
+
+ WRITE_NODE_FIELD(item);
+ WRITE_UINT_FIELD(abslevel);
+}
+
/*****************************************************************************
*
* Stuff from parsenodes.h.
@@ -2195,6 +2217,9 @@ _outNode(StringInfo str, void *obj)
case T_HashPath:
_outHashPath(str, obj);
break;
+ case T_PlannerGlobal:
+ _outPlannerGlobal(str, obj);
+ break;
case T_PlannerInfo:
_outPlannerInfo(str, obj);
break;
@@ -2228,6 +2253,9 @@ _outNode(StringInfo str, void *obj)
case T_AppendRelInfo:
_outAppendRelInfo(str, obj);
break;
+ case T_PlannerParamItem:
+ _outPlannerParamItem(str, obj);
+ break;
case T_CreateStmt:
_outCreateStmt(str, obj);