On 25 October 2010 07:36, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Looks like the invalItems list has been clobbered:
>
> (gdb) p *root->glob->invalItems
> $6 = {type = 2139062143, length = 2139062143, head = 0x7f7f7f7f,
>  tail = 0x7f7f7f7f}
>
> I'm guessing it was modified in the temporary memory context and not
> properly copied out to the parent context when we finished inlining
> the function.

I note that the error goes away if I do any of the following with my test case:

 a) define the SRF as having no arguments, or
 b) make the argument passed into the SRF a constant rather than a
call to a function, or
 c) make the argument function (year) itself take no arguments, or
 d) make the argument passed to year a constant rather than current_date, or
 e) define year as VOLATILE, or
 f) put the call to segfault_setof into a subquery in the FROM clause.

So this only manifests under a pretty specific type of query tree; a
function call as the argument to another function call, which is an
argument to an inlinable SRF in FROM.

Cheers,
BJ

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to