Commit 611afd9f authored by Tom Lane's avatar Tom Lane

Repair crash in EvalPlanQual of query involving nestloop with inner

index scan.  Problem was that link to outer tuple wasn't being stored
everyplace it needed to be.
parent 0f214ede
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.64 2001/10/28 06:25:43 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.65 2001/11/12 17:18:06 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -339,10 +339,17 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent) ...@@ -339,10 +339,17 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
{ {
/* /*
* If we are being passed an outer tuple, save it for runtime key * If we are being passed an outer tuple, save it for runtime key
* calc * calc. We also need to link it into the "regular" per-tuple
* econtext, so it can be used during indexqualorig evaluations.
*/ */
if (exprCtxt != NULL) if (exprCtxt != NULL)
{
ExprContext *stdecontext;
econtext->ecxt_outertuple = exprCtxt->ecxt_outertuple; econtext->ecxt_outertuple = exprCtxt->ecxt_outertuple;
stdecontext = node->scan.scanstate->cstate.cs_ExprContext;
stdecontext->ecxt_outertuple = exprCtxt->ecxt_outertuple;
}
/* /*
* Reset the runtime-key context so we don't leak memory as each * Reset the runtime-key context so we don't leak memory as each
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment