Skip to content

Commit acf242d

Browse files
committed
Plug hole in dike: planner would coredump if query_planner
returned NULL, which it will do in some cases where an elog(ERROR) would probably be more appropriate. For the moment, generate a not-very- informative error message rather than proceeding to certain coredump. Probably ought to think about making query_planner elog instead of returning NULL, but this is at least a safe change for now.
1 parent 1918a1d commit acf242d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.55 1999/06/06 17:38:10 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.56 1999/06/12 19:27:41 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -223,6 +223,10 @@ union_planner(Query *parse)
223223
pfree(vpm);
224224
}
225225

226+
/* query_planner returns NULL if it thinks plan is bogus */
227+
if (! result_plan)
228+
elog(ERROR, "union_planner: failed to create plan");
229+
226230
/*
227231
* If we have a GROUP BY clause, insert a group node (with the
228232
* appropriate sort node.)

0 commit comments

Comments
 (0)