aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execScan.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-05-21 14:30:11 -0400
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-05-21 14:30:11 -0400
commit0319da638f337cae66a4649581dc1f33d5079e1a (patch)
tree0b7f20d832c41149274b6dfc27a17c79b4eb9328 /src/backend/executor/execScan.c
parent27c7875d95cf629e3f344ba91d1f8a1a936ed043 (diff)
downloadpostgresql-0319da638f337cae66a4649581dc1f33d5079e1a.tar.gz
postgresql-0319da638f337cae66a4649581dc1f33d5079e1a.zip
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.
Diffstat (limited to 'src/backend/executor/execScan.c')
-rw-r--r--src/backend/executor/execScan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/executor/execScan.c b/src/backend/executor/execScan.c
index 5089616f595..e90058847d9 100644
--- a/src/backend/executor/execScan.c
+++ b/src/backend/executor/execScan.c
@@ -120,13 +120,17 @@ ExecScan(ScanState *node,
*/
qual = node->ps.qual;
projInfo = node->ps.ps_ProjInfo;
+ econtext = node->ps.ps_ExprContext;
/*
* If we have neither a qual to check nor a projection to do, just skip
* all the overhead and return the raw scan tuple.
*/
if (!qual && !projInfo)
+ {
+ ResetExprContext(econtext);
return ExecScanFetch(node, accessMtd, recheckMtd);
+ }
/*
* Check to see if we're still projecting out tuples from a previous scan
@@ -148,7 +152,6 @@ ExecScan(ScanState *node,
* storage allocated in the previous tuple cycle. Note this can't happen
* until we're done projecting out tuples from a scan tuple.
*/
- econtext = node->ps.ps_ExprContext;
ResetExprContext(econtext);
/*