1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-21 02:52:47 +03:00

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.
This commit is contained in:
Tom Lane
2007-02-19 07:03:34 +00:00
parent 90c301aaa9
commit 7c5e5439d2
18 changed files with 293 additions and 223 deletions

View File

@@ -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*
@@ -1225,6 +1225,16 @@ _outHashPath(StringInfo str, HashPath *node)
WRITE_NODE_FIELD(path_hashclauses);
}
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)
{
@@ -1232,7 +1242,10 @@ _outPlannerInfo(StringInfo str, PlannerInfo *node)
/* 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);