Re: havingQual vs hasHavingQual buglets

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: havingQual vs hasHavingQual buglets
Date: 2022-10-18 09:23:49
Message-ID: CAPmGK14uQdQbsv1LSQ5GdxyqNddhceseEjd7-zojXOBQdSmkWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 18, 2022 at 9:47 AM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> On Tue, Oct 18, 2022 at 5:37 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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 be folded to
>> empty). Correct code is to check root->hasHavingQual instead.

The postgres_fdw bits would be my oversight. :-(

> +1. root->hasHavingQual is set before we do any expression
> preprocessing. It should be the right one to check with.

+1 HEAD only seems reasonable.

Best regards,
Etsuro Fujita

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2022-10-18 09:27:32 RE: CF Bot failure in wait_for_subscription_sync()
Previous Message Richard Guo 2022-10-18 09:13:53 Re: Unnecessary lateral dependencies implied by PHVs