-- TRAP: FailedAssertion("!(!((((const Node*)(node))->type) == T_SubLink))", File: "prepunion.c", Line: 2246)

begin;
CREATE TABLE prt1 (
    a integer,
    b integer,
    c character varying
)
PARTITION BY RANGE (a);

CREATE TABLE prt1_p1 PARTITION OF prt1
FOR VALUES FROM (0) TO (250);
CREATE TABLE prt1_p2 PARTITION OF prt1
FOR VALUES FROM (250) TO (500);
CREATE TABLE prt1_p3 PARTITION OF prt1
FOR VALUES FROM (500) TO (600);

CREATE TABLE tenk1 (stringu1 name);
CREATE TABLE onek2 (like tenk1);

explain MERGE INTO public.onek2 as target_0
USING public.prt1 as ref_0
  inner join public.tenk1 as ref_1
  on ((select 1::text is not null))
ON target_0.stringu1 = ref_1.stringu1
WHEN NOT MATCHED THEN DO NOTHING;

rollback;
