Re: BUG #19942: SIGSEGV crash (and wrong results) in MERGE ... RETURNING WITH (OLD/NEW) with VIRTUAL generated colum

From: Tender Wang <tndrwang(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: 798604270(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19942: SIGSEGV crash (and wrong results) in MERGE ... RETURNING WITH (OLD/NEW) with VIRTUAL generated colum
Date: 2026-11-26 00:52:04
Message-ID: CAHewXNnMYujEt0DU1PWrPLEiEUoF=reTfphvpwLwV_zy+WChzA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

Kirill Reshke <reshkekirill(at)gmail(dot)com> 于2026年11月26日周四 02:07写道:

> > This test case triggers a crash:
> > This test case triggers a wrong result:

> Looks like regression since 17550c8a
>

I confirmed that this is a regression introduced by 17550c8a change to
transform_MERGE_to_join(), which started applying the MERGE join’s
nulling relids to target Vars in the RETURNING list.
Skipping that step for JOIN_RIGHT makes both examples return the
expected results. I also confirmed that the crash still occurs with a
FULL JOIN.

I’m looking into the fix.

--
Tender Wang

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tender Wang 2026-11-26 02:06:16 Re: BUG #19942: SIGSEGV crash (and wrong results) in MERGE ... RETURNING WITH (OLD/NEW) with VIRTUAL generated colum
Previous Message Lukas Fittl 2026-11-25 19:43:25 Re: BUG #19939: In a read-only transaction, a plain SELECT ... INTO is refused, but the same statement under EXPLAIN