On Mon, May 26, 2025 at 4:11 AM Dean Rasheed <dean.a.rasheed@gmail.com> wrote: > > On Sun, 25 May 2025 at 13:41, Dean Rasheed <dean.a.rasheed@gmail.com> wrote: > > > > 2. ExecInitModifyTable() does not initialize the WCO lists or > RETURNING list for rootResultRelInfo, so those never get executed. > > As it happens, it is possible to construct cases where (1) causes a > crash, even without WCO's or a RETURNING list (see the first test case > in the attached patch), so this bug goes all the way back to v15, > where MERGE was introduced. > > So I think we need to do something like the attached. > > There is perhaps scope to reduce the code duplication between this and > ExecInitPartitionInfo(), but that'd likely make the patch bigger, so I > think it's best to leave that for now.