Re: v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-12 Thread Robert Haas
On Thu, May 11, 2023 at 4:16 PM Kirk Wolak wrote: > Forgive the noob question... But does this trigger a regression test to be > created? > And who tracks/pushes that? Tom included one in the commit. -- Robert Haas EDB: http://www.enterprisedb.com

Re: v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-11 Thread Kirk Wolak
On Thu, May 11, 2023 at 11:50 AM Robert Haas wrote: > On Thu, May 11, 2023 at 10:14 AM Robert Haas > wrote: > > Ouch, so we've had a known queries-returning-wrong-answers bug for > > more than two months. That's not great. I'll try to find time today to > > check whether the patches on that thre

Re: v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-11 Thread Robert Haas
On Thu, May 11, 2023 at 1:46 PM Tom Lane wrote: > > What I'm inclined to do about it is just revert this particular > > change. But I'd better run around and see where else I did that, > > because the idea is evidently not ready for prime time. > > Looks like that was the only such change in 2489

Re: v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-11 Thread Tom Lane
I wrote: > Yeah, I've just traced the problem to remove_rel_from_query() deciding > that it can drop the qual of interest :-(. I'd done this: > - if (RINFO_IS_PUSHED_DOWN(rinfo, joinrelids)) > + if (bms_is_member(ojrelid, rinfo->required_relids)) > as part of an unfinished effort at ge

Re: v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-11 Thread Tom Lane
Robert Haas writes: > On Thu, May 11, 2023 at 10:14 AM Robert Haas wrote: >> Ouch, so we've had a known queries-returning-wrong-answers bug for >> more than two months. That's not great. I'll try to find time today to >> check whether the patches on that thread resolve this issue. > I tried out

Re: v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-11 Thread Robert Haas
On Thu, May 11, 2023 at 10:14 AM Robert Haas wrote: > Ouch, so we've had a known queries-returning-wrong-answers bug for > more than two months. That's not great. I'll try to find time today to > check whether the patches on that thread resolve this issue. I tried out the v3 patches from that thr

Re: v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-11 Thread Robert Haas
On Thu, May 11, 2023 at 9:57 AM Tom Lane wrote: > Robert Haas writes: > > While merging commits from c9f7f926484d69e2806e35343af7e472fadfede7 > > through 3db72ebcbe20debc6552500ee9ccb4b2007f12f8 into a fork, my > > colleague Rushabh Lathia and I noticed that the merge caused certain > > queries t

Re: v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-11 Thread Tom Lane
Robert Haas writes: > While merging commits from c9f7f926484d69e2806e35343af7e472fadfede7 > through 3db72ebcbe20debc6552500ee9ccb4b2007f12f8 into a fork, my > colleague Rushabh Lathia and I noticed that the merge caused certain > queries to return wrong answers. I believe this is a variant of the

v16 regression - wrong query results with LEFT JOINs + join removal

2023-05-11 Thread Robert Haas
While merging commits from c9f7f926484d69e2806e35343af7e472fadfede7 through 3db72ebcbe20debc6552500ee9ccb4b2007f12f8 into a fork, my colleague Rushabh Lathia and I noticed that the merge caused certain queries to return wrong answers. Rushabh then discovered that this also happens in unmodified Pos