Re: havingQual vs hasHavingQual buglets

2022-10-18 Thread Tom Lane
Etsuro Fujita writes: > On Tue, Oct 18, 2022 at 9:47 AM Richard Guo wrote: >> On Tue, Oct 18, 2022 at 5:37 AM Tom Lane wrote: >>> I came across a couple of places in the planner that are checking >>> for nonempty havingQual; but since these bits run after >>> const-simplification of the HAVING c

Re: havingQual vs hasHavingQual buglets

2022-10-18 Thread Etsuro Fujita
On Tue, Oct 18, 2022 at 9:47 AM Richard Guo wrote: > On Tue, Oct 18, 2022 at 5:37 AM Tom Lane wrote: >> I came across a couple of places in the planner that are checking >> for nonempty havingQual; but since these bits run after >> const-simplification of the HAVING clause, that produces the wron

Re: havingQual vs hasHavingQual buglets

2022-10-17 Thread Richard Guo
On Tue, Oct 18, 2022 at 5:37 AM Tom Lane wrote: > I came across a couple of places in the planner that are checking > for nonempty havingQual; but since these bits run after > const-simplification of the HAVING clause, that produces the wrong > answer for a constant-true HAVING clause (which'll b

havingQual vs hasHavingQual buglets

2022-10-17 Thread Tom Lane
I came across a couple of places in the planner that are checking for nonempty havingQual; but since these bits run after const-simplification of the HAVING clause, that produces the wrong answer for a constant-true HAVING clause (which'll be folded to empty). Correct code is to check root->hasHav