On Mon, 23 Nov 2026 at 09:11, Tender Wang <[email protected]> wrote: > > Dean Rasheed <[email protected]> 于2026年11月22日周日 19:32写道: > > > > I think a better (more localised) solution is to have > > ExecMergeMatched() swap out context->planSlot while it executes the > > NOT MATCHED BY SOURCE action. That feels more robust, because it > > removes any chance of any code called while executing the action > > seeing the old stale source values. Something like v2, attached. > > > Yeah, I agree that temporarily replacing context->planSlot in > ExecMergeMatched() is cleaner. > It gives the entire NOT MATCHED BY SOURCE action a consistent view of > the source row, including the cross-partition RETURNING path. > Restoring the original slot before returning also makes it available > to any subsequent NOT MATCHED BY TARGET action. > > > Also, I don't think merge-match-recheck is the right place to test > > this, since it's not about rechecking AND conditions. I've added new > > tests to merge-not-matched, based on the ones added before for bug > > #19912, testing both left and full joins. > > +1
Pushed and back-patched to v17. Regards, Dean
