Repair guaranteed core dump in SPI_exec(). Guess this routine wasn't
authorTom Lane
Thu, 4 Jan 2001 02:36:52 +0000 (02:36 +0000)
committerTom Lane
Thu, 4 Jan 2001 02:36:52 +0000 (02:36 +0000)
used before ...

src/backend/executor/spi.c

index b309dc5022eddcd9b25284f4624e7300c98d140e..f07c0fcdbae627eb6b4dd7b460c84f781fca1ef2 100644 (file)
@@ -3,7 +3,7 @@
  * spi.c
  *             Server Programming Interface
  *
- * $Id: spi.c,v 1.50 2000/12/01 22:10:30 tgl Exp $
+ * $Id: spi.c,v 1.51 2001/01/04 02:36:52 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -695,8 +695,11 @@ _SPI_execute(char *src, int tcount, _SPI_plan *plan)
        }
    }
 
-   plan->qtlist = queryTree_list;
-   plan->ptlist = planTree_list;
+   if (plan)
+   {
+       plan->qtlist = queryTree_list;
+       plan->ptlist = planTree_list;
+   }
 
    return res;
 }