Subject: Re: [BUGS] Bug #514: Backend crashes periodically From: Tom Lane To: Warren Volz cc: Barry Lind , pgsql-bugs@postgresql.org Date: Mon, 12 Nov 2001 12:23:30 -0500 Comments: In-reply-to Warren Volz message dated "Sun, 11 Nov 2001 23:20:20 -0500" I believe I have found and fixed the crash-in-EvalPlanQual problem you two reported. The patch for current sources is attached --- it should work in 7.1.* too, although line numbers might be off a bit. regards, tom lane *** src/backend/executor/nodeIndexscan.c.orig Mon Oct 29 15:30:53 2001 --- src/backend/executor/nodeIndexscan.c Mon Nov 12 12:18:06 2001 *************** *** 339,348 **** { /* * If we are being passed an outer tuple, save it for runtime key ! * calc */ if (exprCtxt != NULL) econtext->ecxt_outertuple = exprCtxt->ecxt_outertuple; /* * Reset the runtime-key context so we don't leak memory as each --- 339,355 ---- { /* * If we are being passed an outer tuple, save it for runtime key ! * calc. We also need to link it into the "regular" per-tuple ! * econtext, so it can be used during indexqualorig evaluations. */ if (exprCtxt != NULL) + { + ExprContext *stdecontext; + 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 ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)