Re: BUG #17768: Assert triggered on initsplan.c - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17768: Assert triggered on initsplan.c
Date
Msg-id 1600595.1675385245@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17768: Assert triggered on initsplan.c  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: BUG #17768: Assert triggered on initsplan.c
List pgsql-bugs
Richard Guo <guofenglinux@gmail.com> writes:
>> There is something wrong about postponing quals.  We are supposed to
>> postpone quals only from children to their parent nodes.  But here in
>> deconstruct_distribute we scan all the jointree nodes in depth-first
>> traversal order and any quals postponed by left children may be checked
>> against right children.  If the right subtree is an outer join as in
>> this example, the assertion would be triggered.

> To fix this issue, I'm considering that we can add two types of info in
> JoinTreeItem for each jointree node, one is the jointree's children, and
> one is the list of quals that need to be postponed at this join level.
> Thus in deconstruct_distribute we can process the quals postponed by
> children.

I've not looked closely at this, but ... I remember thinking while
revising deconstruct_jointree that the whole PostponedQual mechanism
was a wart we should try to get rid of.  I didn't touch it since
I saw no obvious bugs and the patch was too large already, but maybe
now is the time to try harder.  In any case I suspect you are right
that the core of this issue is that we're dealing with PostponedQuals
in the wrong order now.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17770: SELECT FOR UPDATE on a UNION ALL view doesn't raise an error
Next
From: Richard Guo
Date:
Subject: Re: BUG #17769: Assert triggered in indxpath.c