aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-07-04 01:03:01 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-07-04 01:03:01 +0000
commitb31aa64f4aa065de5fe7be1a2a204675775245ec (patch)
tree79c8c0301abd448e2cbac1264f6f3b13fe233127
parentefb621278ef9bf11ec4c62452818735fd9e5a377 (diff)
downloadpostgresql-b31aa64f4aa065de5fe7be1a2a204675775245ec.tar.gz
postgresql-b31aa64f4aa065de5fe7be1a2a204675775245ec.zip
Make exec_simple_check_plan() check for a null plan, so
that it doesn't crash when processing a utility statement.
-rw-r--r--src/pl/plpgsql/src/pl_exec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 48ff11a040e..02bdf6caa12 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -3,7 +3,7 @@
* 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.
*
@@ -2477,7 +2477,7 @@ exec_simple_check_plan(PLpgSQL_expr * expr)
* 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);
@@ -2486,6 +2486,9 @@ exec_simple_check_plan(PLpgSQL_expr * expr)
* 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;