From 71b4790b6d7e35ba7a8f8197f2a2ddd663983ac2 Mon Sep 17 00:00:00 2001 From: "Vadim B. Mikheev" Date: Fri, 7 Apr 2000 07:24:47 +0000 Subject: [PATCH] Commebts & one check in EndEvalPlanQual(). --- src/backend/executor/execMain.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index d19baaa84d..bbcba0fbc1 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -27,7 +27,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.111 2000/04/07 00:59:17 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.112 2000/04/07 07:24:47 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -2022,15 +2022,21 @@ EndEvalPlanQual(EState *estate) EState *epqstate = &(epq->estate); evalPlanQual *oldepq; - if (epq->rti == 0) /* still live? */ + if (epq->rti == 0) /* plans already shutdowned */ + { + Assert(epq->estate.es_evalPlanQual == NULL); return; + } for (;;) { ExecEndNode(epq->plan, epq->plan); epqstate->es_tupleTable->next = 0; - heap_freetuple(epqstate->es_evTuple[epq->rti - 1]); - epqstate->es_evTuple[epq->rti - 1] = NULL; + if (epqstate->es_evTuple[epq->rti - 1] != NULL) + { + heap_freetuple(epqstate->es_evTuple[epq->rti - 1]); + epqstate->es_evTuple[epq->rti - 1] = NULL; + } /* pop old PQ from the stack */ oldepq = (evalPlanQual *) epqstate->es_evalPlanQual; if (oldepq == (evalPlanQual *) NULL) -- 2.40.0