diff options
Diffstat (limited to 'src/backend/tcop/pquery.c')
-rw-r--r-- | src/backend/tcop/pquery.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index 24d4aac8b2c..1e02e42193d 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.57 2002/12/05 15:50:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.58 2002/12/15 16:17:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -52,6 +52,18 @@ CreateQueryDesc(Query *parsetree, return qd; } +/* + * FreeQueryDesc + */ +void +FreeQueryDesc(QueryDesc *qdesc) +{ + /* Can't be a live query */ + Assert(qdesc->estate == NULL); + /* Only the QueryDesc itself need be freed */ + pfree(qdesc); +} + /* ---------------- * PreparePortal * ---------------- @@ -152,9 +164,8 @@ ProcessQuery(Query *parsetree, * QueryDesc */ /* - * We stay in portal's memory context for now, so that query desc, - * exec state, and plan startup info are also allocated in the portal - * context. + * We stay in portal's memory context for now, so that query desc + * is also allocated in the portal context. */ } @@ -231,4 +242,6 @@ ProcessQuery(Query *parsetree, * Now, we close down all the scans and free allocated resources. */ ExecutorEnd(queryDesc); + + FreeQueryDesc(queryDesc); } |