Re: BUG #18114: FULL JOIN is replaced by LEFT JOIN in plan

From: Wèi Cōngruì <crvv(dot)mail(at)gmail(dot)com>
To: Ilya Anfimov <ilan(at)tzirechnoy(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18114: FULL JOIN is replaced by LEFT JOIN in plan
Date: 2023-09-17 01:03:21
Message-ID: CAPxZtjFb_E_Nu6pqN2rHQ-jf+cS59EeGqZ80HAHJvL1zxW+NKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Yes, I also realized it.
The result depends on the JOIN order and the comma changed the order.

On Sun, Sep 17, 2023 at 3:06 AM Ilya Anfimov <ilan(at)tzirechnoy(dot)com> wrote:
>
> On Sat, Sep 16, 2023 at 11:32:15PM +1000, W??i C??ngru?? wrote:
> > This is not a bug. The row is filtered by the WHERE clause.
> > Sorry for disturbing.
> >
> > On Sat, Sep 16, 2023, 22:36 PG Bug reporting form <noreply(at)postgresql(dot)org>
> > wrote:
> >
> > The following bug has been logged on the website:
> >
> > Bug reference: 18114
> > Logged by: crvv
> > Email address: crvv(dot)mail(at)gmail(dot)com
> > PostgreSQL version: 16.0
> > Operating system: Linux
> > Description:
> >
> > SELECT * FROM (VALUES (1)) AS t(id)
> > CROSS JOIN unnest('{1,2}'::int[]) AS a(x)
> > FULL JOIN unnest('{2,3}'::int[]) AS b(x) ON a.x = b.x
> > WHERE t.id = 1
> >
> > Execute this SQL, I get the result
> > id | x | x
> > ----+---+---
> > 1 | 1 |
> > 1 | 2 | 2
> >
> > My expection is
> > id | x | x
> > ----+---+---
> > 1 | 1 |
> > 1 | 2 | 2
> > | | 3
>
> Your expectation is incorrect.
> Last record has null t.id (not 1), so it was
> filtered out by WHERE.
>
>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2023-09-17 01:50:36 Re: BUG #18070: Assertion failed when processing error from plpy's iterator
Previous Message Tom Lane 2023-09-17 00:02:03 Re: BUG #18070: Assertion failed when processing error from plpy's iterator