Re: Consistent segfault in complex query

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Kyle Samson <kysamson@tripadvisor.com>, "pgsql-hackers\@postgresql.org" <pgsql-hackers@postgresql.org>, Matthew Kelly <mkelly@tripadvisor.com>
Date: 2018-09-13T22:18:42Z
Lists: pgsql-hackers

Attachments

I wrote:
> Your other idea of forcing initPlan parameters to be evaluated before we
> enter the EPQ execution environment is probably more workable.

Concretely, the attached seems to be enough to fix it (though I only
tried the simplest case you posted).

I don't find anything to love about ExecEvalParamExecParams: it's badly
named, badly located, full of undocumented assumptions, and probably
causes a memory leak.  Plus it doesn't exist as far back as we need it
for this.  But fixing those problems is a separable task.  In the
meantime, this is an expedient way to test whether this approach can work.

			regards, tom lane

Commits

  1. Fix failure with initplans used conditionally during EvalPlanQual rechecks.