Re: BUG #18871: Cross-partition MERGE fails with unclear internal error

From: Tender Wang <tndrwang(at)gmail(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18871: Cross-partition MERGE fails with unclear internal error
Date: 2025-03-29 02:39:12
Message-ID: CAHewXNkN7fN7sh1VapmOb+C7BW+tm9U=0T4TSs5=bEF+-A0u8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> 于2025年3月29日周六 02:29写道:

> On Fri, 28 Mar 2025 at 16:40, Tender Wang <tndrwang(at)gmail(dot)com> wrote:
> >
> > I tried a quick fix by adding "case CMD_NOTHING" after "case CMD_DELETE"
> like below:
> >
> > case CMD_DELETE:
> > case CMD_NOTHING:
> > break;
> >
> > It can work, and all regression tests pass. But I don't look into more
> details. This solution may not fix the root cause.
>
> Yes, that looks like the right fix.
>
> This appears to be a trivial oversight in ExecInitPartitionInfo(). I
> did a quick scan of other places that look at action->commandType and
> I didn't see any others that overlook CMD_NOTHING.
>

Yes, indeed. I double-check it.
In ExecInitPartitionInfo(), it has comments like:

* This duplicates much of the logic in ExecInitMerge(), so something
* changes there, look here too.

ExecInitMerge() considers CMD_NOTHING operation.
I give the attached fix.

--
Thanks,
Tender Wang

Attachment Content-Type Size
0001-Fix-cross-partition-merge-fail.patch text/plain 2.7 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gurjeet Singh 2025-03-29 05:54:50 Re: BUG #18871: Cross-partition MERGE fails with unclear internal error
Previous Message Dean Rasheed 2025-03-28 18:29:45 Re: BUG #18871: Cross-partition MERGE fails with unclear internal error