that it doesn't crash when processing a utility statement.
* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.11 1999/05/25 16:15:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.12 1999/07/04 01:03:01 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
* execution plan
* ----------
*/
- if (spi_plan->ptlist == NULL || length(spi_plan->ptlist) != 1)
+ if (length(spi_plan->ptlist) != 1)
return;
plan = (Plan *) lfirst(spi_plan->ptlist);
* 2. It must be a RESULT plan --> no scan's required
* ----------
*/
+ if (plan == NULL) /* utility statement produces this */
+ return;
+
if (nodeTag(plan) != T_Result)
return;