diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-16 03:49:10 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-16 03:49:10 +0000 |
commit | 36e24e8d17b72204568ff7df8fce51adf31dc024 (patch) | |
tree | e19067afd4048b13d154d901592f8ec116a02035 /src/backend/executor/nodeResult.c | |
parent | 84222cf0dd97d94bbbfcb5f87a4c6e71c8537bc5 (diff) | |
download | postgresql-36e24e8d17b72204568ff7df8fce51adf31dc024.tar.gz postgresql-36e24e8d17b72204568ff7df8fce51adf31dc024.zip |
Fix another problem in 8.2 changes that allowed "one-time" qual conditions to
be checked at plan levels below the top; namely, we have to allow for Result
nodes inserted just above a nestloop inner indexscan. Should think about
using the general Param mechanism to pass down outer-relation variables, but
for the moment we need a back-patchable solution. Per report from Phil Frost.
Diffstat (limited to 'src/backend/executor/nodeResult.c')
-rw-r--r-- | src/backend/executor/nodeResult.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/executor/nodeResult.c b/src/backend/executor/nodeResult.c index c698daa317b..75760dab98a 100644 --- a/src/backend/executor/nodeResult.c +++ b/src/backend/executor/nodeResult.c @@ -38,7 +38,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeResult.c,v 1.34.2.3 2007/02/15 03:07:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeResult.c,v 1.34.2.4 2007/02/16 03:49:10 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -309,10 +309,12 @@ ExecReScanResult(ResultState *node, ExprContext *exprCtxt) node->rs_checkqual = (node->resconstantqual == NULL) ? false : true; /* - * if chgParam of subnode is not null then plan will be re-scanned by - * first ExecProcNode. + * If chgParam of subnode is not null then plan will be re-scanned by + * first ExecProcNode. However, if caller is passing us an exprCtxt + * then forcibly rescan the subnode now, so that we can pass the + * exprCtxt down to the subnode (needed for gated indexscan). */ - if (((PlanState *) node)->lefttree && - ((PlanState *) node)->lefttree->chgParam == NULL) - ExecReScan(((PlanState *) node)->lefttree, exprCtxt); + if (node->ps.lefttree && + (node->ps.lefttree->chgParam == NULL || exprCtxt != NULL)) + ExecReScan(node->ps.lefttree, exprCtxt); } |