7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.12 1997/12/18 12:54:11 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.13 1997/12/18 19:41:44 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
47
47
#include "executor/executor.h"
48
48
49
49
static Plan * make_sortplan (List * tlist , List * sortcls , Plan * plannode );
50
- static Plan * init_query_planner (Query * parse );
51
50
52
51
/*****************************************************************************
53
52
*
@@ -77,6 +76,8 @@ planner(Query *parse)
77
76
78
77
Plan * result_plan = (Plan * ) NULL ;
79
78
79
+ List * preprocessed_tlist = NIL ;
80
+ List * primary_qual ;
80
81
int rt_index ;
81
82
82
83
/*
@@ -93,8 +94,20 @@ planner(Query *parse)
93
94
if (special_plans )
94
95
result_plan = special_plans ;
95
96
else
96
- result_plan = init_query_planner (parse ); /* regular plans */
97
+ {
98
+ preprocessed_tlist = preprocess_targetlist (tlist ,
99
+ parse -> commandType ,
100
+ parse -> resultRelation ,
101
+ parse -> rtable );
102
+
103
+ primary_qual = cnfify ((Expr * ) parse -> qual , true);
97
104
105
+ result_plan = query_planner (parse ,
106
+ parse -> commandType ,
107
+ preprocessed_tlist ,
108
+ primary_qual );
109
+ }
110
+
98
111
/*
99
112
* For now, before we hand back the plan, check to see if there is a
100
113
* user-specified sort that needs to be done. Eventually, this will
@@ -180,34 +193,6 @@ make_sortplan(List *tlist, List *sortcls, Plan *plannode)
180
193
return (sortplan );
181
194
}
182
195
183
-
184
- /*
185
- * init-query-planner--
186
- * Deals with all non-union preprocessing,and CNFifying the qualifications.
187
- *
188
- * Returns a query plan.
189
- * MODIFIES: tlist,qual
190
- *
191
- */
192
- static Plan *
193
- init_query_planner (Query * root )
194
- {
195
- List * primary_qual ;
196
- List * tlist = root -> targetList ;
197
-
198
- tlist = preprocess_targetlist (tlist ,
199
- root -> commandType ,
200
- root -> resultRelation ,
201
- root -> rtable );
202
-
203
- primary_qual = cnfify ((Expr * ) root -> qual , true);
204
-
205
- return (query_planner (root ,
206
- root -> commandType ,
207
- tlist ,
208
- primary_qual ));
209
- }
210
-
211
196
/*
212
197
* pg_checkretval() -- check return value of a list of sql parse
213
198
* trees.
0 commit comments