Commit 8759b79d authored by Alvaro Herrera's avatar Alvaro Herrera

Add a couple of missing FreeQueryDesc calls. Noticed while testing a

framework to keep track of snapshots in use.
parent 4e228447
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/portalcmds.c,v 1.69 2008/01/01 19:45:49 momjian Exp $ * $PostgreSQL: pgsql/src/backend/commands/portalcmds.c,v 1.70 2008/03/20 20:05:56 alvherre Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -262,6 +262,7 @@ PortalCleanup(Portal portal) ...@@ -262,6 +262,7 @@ PortalCleanup(Portal portal)
CurrentResourceOwner = portal->resowner; CurrentResourceOwner = portal->resowner;
/* we do not need AfterTriggerEndQuery() here */ /* we do not need AfterTriggerEndQuery() here */
ExecutorEnd(queryDesc); ExecutorEnd(queryDesc);
FreeQueryDesc(queryDesc);
} }
PG_CATCH(); PG_CATCH();
{ {
...@@ -362,6 +363,7 @@ PersistHoldablePortal(Portal portal) ...@@ -362,6 +363,7 @@ PersistHoldablePortal(Portal portal)
portal->queryDesc = NULL; /* prevent double shutdown */ portal->queryDesc = NULL; /* prevent double shutdown */
/* we do not need AfterTriggerEndQuery() here */ /* we do not need AfterTriggerEndQuery() here */
ExecutorEnd(queryDesc); ExecutorEnd(queryDesc);
FreeQueryDesc(queryDesc);
/* /*
* Set the position in the result set: ideally, this could be * Set the position in the result set: ideally, this could be
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.188 2008/02/12 04:09:44 tgl Exp $ * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.189 2008/03/20 20:05:56 alvherre Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1541,7 +1541,6 @@ _SPI_execute_plan(SPIPlanPtr plan, Datum *Values, const char *Nulls, ...@@ -1541,7 +1541,6 @@ _SPI_execute_plan(SPIPlanPtr plan, Datum *Values, const char *Nulls,
{ {
Node *stmt = (Node *) lfirst(lc2); Node *stmt = (Node *) lfirst(lc2);
bool canSetTag; bool canSetTag;
QueryDesc *qdesc;
DestReceiver *dest; DestReceiver *dest;
_SPI_current->processed = 0; _SPI_current->processed = 0;
...@@ -1617,6 +1616,8 @@ _SPI_execute_plan(SPIPlanPtr plan, Datum *Values, const char *Nulls, ...@@ -1617,6 +1616,8 @@ _SPI_execute_plan(SPIPlanPtr plan, Datum *Values, const char *Nulls,
if (IsA(stmt, PlannedStmt) && if (IsA(stmt, PlannedStmt) &&
((PlannedStmt *) stmt)->utilityStmt == NULL) ((PlannedStmt *) stmt)->utilityStmt == NULL)
{ {
QueryDesc *qdesc;
qdesc = CreateQueryDesc((PlannedStmt *) stmt, qdesc = CreateQueryDesc((PlannedStmt *) stmt,
ActiveSnapshot, ActiveSnapshot,
crosscheck_snapshot, crosscheck_snapshot,
...@@ -1790,6 +1791,7 @@ _SPI_pquery(QueryDesc *queryDesc, bool fire_triggers, long tcount) ...@@ -1790,6 +1791,7 @@ _SPI_pquery(QueryDesc *queryDesc, bool fire_triggers, long tcount)
AfterTriggerEndQuery(queryDesc->estate); AfterTriggerEndQuery(queryDesc->estate);
ExecutorEnd(queryDesc); ExecutorEnd(queryDesc);
/* FreeQueryDesc is done by the caller */
#ifdef SPI_EXECUTOR_STATS #ifdef SPI_EXECUTOR_STATS
if (ShowExecutorStats) if (ShowExecutorStats)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment