Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f3da9a

Browse files
committed
Remove unnecessary EvalPlanQual support code --- since this plan node
type never scans a relation directly, it can't be an EPQ target.Explicitly drop subplan's tuple table to ensure we have no buffer pinleaks.
1 parentd0e1091 commit6f3da9a

File tree

1 file changed

+10
-31
lines changed

1 file changed

+10
-31
lines changed

‎src/backend/executor/nodeSubqueryscan.c

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubqueryscan.c,v 1.7 2001/05/08 19:47:02 tgl Exp $
15+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubqueryscan.c,v 1.8 2001/05/15 16:11:58 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -61,28 +61,11 @@ SubqueryNext(SubqueryScan *node)
6161
estate=node->scan.plan.state;
6262
subquerystate= (SubqueryScanState*)node->scan.scanstate;
6363
direction=estate->es_direction;
64-
slot=subquerystate->csstate.css_ScanTupleSlot;
6564

6665
/*
67-
* Check if we are evaluating PlanQual for tuple of this relation.
68-
* Additional checking is not good, but no other way for now. We could
69-
* introduce new nodes for this case and handle SubqueryScan -->
70-
* NewNode switching in Init/ReScan plan...
66+
* We need not support EvalPlanQual here, since we are not scanning
67+
* a real relation.
7168
*/
72-
if (estate->es_evTuple!=NULL&&
73-
estate->es_evTuple[node->scan.scanrelid-1]!=NULL)
74-
{
75-
ExecClearTuple(slot);
76-
if (estate->es_evTupleNull[node->scan.scanrelid-1])
77-
returnslot;/* return empty slot */
78-
79-
ExecStoreTuple(estate->es_evTuple[node->scan.scanrelid-1],
80-
slot,InvalidBuffer, false);
81-
82-
/* Flag for the next call that no more tuples */
83-
estate->es_evTupleNull[node->scan.scanrelid-1]= true;
84-
return (slot);
85-
}
8669

8770
/*
8871
* get the next tuple from the sub-query
@@ -234,12 +217,16 @@ ExecEndSubqueryScan(SubqueryScan *node)
234217
*/
235218
ExecEndNode(node->subplan,node->subplan);
236219

237-
/* XXX we seem to be leaking the sub-EState and tuple table... */
238-
220+
/*
221+
* clean up subquery's tuple table
222+
*/
239223
subquerystate->csstate.css_ScanTupleSlot=NULL;
224+
ExecDropTupleTable(subquerystate->sss_SubEState->es_tupleTable, true);
225+
226+
/* XXX we seem to be leaking the sub-EState... */
240227

241228
/*
242-
* clean out the tuple table
229+
* clean out theuppertuple table
243230
*/
244231
ExecClearTuple(subquerystate->csstate.cstate.cs_ResultTupleSlot);
245232
}
@@ -259,14 +246,6 @@ ExecSubqueryReScan(SubqueryScan *node, ExprContext *exprCtxt, Plan *parent)
259246
subquerystate= (SubqueryScanState*)node->scan.scanstate;
260247
estate=node->scan.plan.state;
261248

262-
/* If this is re-scanning of PlanQual ... */
263-
if (estate->es_evTuple!=NULL&&
264-
estate->es_evTuple[node->scan.scanrelid-1]!=NULL)
265-
{
266-
estate->es_evTupleNull[node->scan.scanrelid-1]= false;
267-
return;
268-
}
269-
270249
/*
271250
* ExecReScan doesn't know about my subplan, so I have to do
272251
* changed-parameter signaling myself.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp