Re: BUG #17976: Inconsistent results of SELECT using CASE WHEN clause

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: zuming(dot)jiang(at)inf(dot)ethz(dot)ch, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17976: Inconsistent results of SELECT using CASE WHEN clause
Date: 2023-06-14 23:55:27
Message-ID: 2025424.1686786927@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> The first bad commit seems to be b448f1c8

Yeah, I think the proximate cause is the removal of the delay_upper_joins
restrictions in analyzejoins.c. That allows us to remove the join to
ref_0, which prior versions didn't do; but then that exposes the need to
clean up dead references in EquivalenceClasses. I'm wondering a bit
now if there are variants of this that'd fail in pre-v16 branches.
It's not obvious to me offhand why delay_upper_joins would have prevented
all cases where a removable rel could be mentioned in an EquivalenceClass
member (presumably via the ph_rels set of a PHV).

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2023-06-14 23:57:11 Re: BUG #17975: Nested Loop Index Scan returning wrong result
Previous Message Tom Lane 2023-06-14 23:34:23 Re: BUG #17976: Inconsistent results of SELECT using CASE WHEN clause