Re: BUG #11457: The below query crashes 9.3.5, but not 9.3.4

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Nelson Page <npage(at)dynamicsignal(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #11457: The below query crashes 9.3.5, but not 9.3.4
Date: 2014-09-26 16:57:18
Message-ID: 7269.1411750638@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Nelson Page wrote:
>> As mentioned in the original title, we cannot reproduce this crash in 9.3.4, but can in 9.3.5. So our particular crash does not go back to 9.1 (unless the 9.1 you mention is some other context maybe?)

> Bug fixes are backpatched to supported branches; 9.3.4 is older than
> 9.1.14. 9.1.14 does contain the backpatched bug fix which seems to have
> introduced the new bug:

The Assert failure mentioned in the other thread reproduces for me back to
9.2; that one is contingent on trying to build a parameterized path, so
of course it wouldn't occur before 9.2. But I imagine other variants of
this issue can be reproduced further back. The fundamental problem is
that we still have work to do to make nested appendrels behave properly.

I think basically the issue here is that in some situations we really want
to find the top-level ancestor appendrel, not just the immediate parent,
as it is the top-level ancestor that will be mentioned in join clauses,
ORDER BY, etc.

I came across a closely related issue too: in
generate_join_implied_equalities_broken we try to translate original join
clauses to apply to a particular child rel by applying the Var translation
from the AppendRelInfo for that child. I think this is wrong for the same
reasons: the original join clause will mention top-level ancestor Vars,
meaning we need to successively apply all the translations working down to
the descendant if we want a correct result.

We could probably hack solutions to these problems without changing the
AppendRelInfo data structures, but I'm wondering if it wouldn't be a good
idea to redefine them or at least add more fields to make it easier to
work with multi-level appendrel ancestry.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-09-26 17:44:39 Re: BUG #11500: PRIMARY KEY index not being used
Previous Message Alvaro Herrera 2014-09-26 15:40:33 Re: BUG #11457: The below query crashes 9.3.5, but not 9.3.4