Skip to content

Commit 0319da6

Browse files
committed
Reset per-tuple memory context between every row in a scan node, even when
there's no quals or projections. Currently this only matters for foreign scans, as none of the other scan nodes litter the per-tuple memory context when there's no quals or projections.
1 parent 27c7875 commit 0319da6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/executor/execScan.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,17 @@ ExecScan(ScanState *node,
120120
*/
121121
qual = node->ps.qual;
122122
projInfo = node->ps.ps_ProjInfo;
123+
econtext = node->ps.ps_ExprContext;
123124

124125
/*
125126
* If we have neither a qual to check nor a projection to do, just skip
126127
* all the overhead and return the raw scan tuple.
127128
*/
128129
if (!qual && !projInfo)
130+
{
131+
ResetExprContext(econtext);
129132
return ExecScanFetch(node, accessMtd, recheckMtd);
133+
}
130134

131135
/*
132136
* Check to see if we're still projecting out tuples from a previous scan
@@ -148,7 +152,6 @@ ExecScan(ScanState *node,
148152
* storage allocated in the previous tuple cycle. Note this can't happen
149153
* until we're done projecting out tuples from a scan tuple.
150154
*/
151-
econtext = node->ps.ps_ExprContext;
152155
ResetExprContext(econtext);
153156

154157
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy