* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.65 2002/10/14 04:20:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.66 2002/10/19 22:10:58 tgl Exp $
*
**********************************************************************/
else if (strcmp(argv[1], "NOTICE") == 0)
level = NOTICE;
else if (strcmp(argv[1], "WARNING") == 0)
- level = ERROR;
+ level = WARNING;
else if (strcmp(argv[1], "ERROR") == 0)
level = ERROR;
else if (strcmp(argv[1], "FATAL") == 0)
}
/************************************************************
- * Save the plan
+ * Save the plan into permanent memory (right now it's in the
+ * SPI procCxt, which will go away at function end).
************************************************************/
qdesc->plan = SPI_saveplan(plan);
if (qdesc->plan == NULL)
elog(ERROR, "pltcl: SPI_saveplan() failed - %s", reason);
}
+ /* Release the procCxt copy to avoid within-function memory leak */
+ SPI_freeplan(plan);
/************************************************************
* Insert a hashtable entry for the plan and return