Re: BUG #18634: Wrong varnullingrels with merge ... when not matched by source
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2024-09-28T00:39:53Z
Lists: pgsql-bugs
On Fri, Sep 27, 2024 at 11:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > Could use some comments ... but actually, now I'm confused about why > any of this is the right thing at all: > > + * Similarly, any non-target Vars in the join condition will be added to > + * the targetlist by preprocess_targetlist(), and so must be marked as > + * nullable by the join, for LEFT and FULL joins. > > Why do we need these Vars in the tlist? If they're for re-evaluating > the join condition, isn't the already-nulled form of them the wrong > thing? I have the same concern. I think we should NOT mark the vars in mergeJoinCondition as nullable, as mergeJoinCondition acts as join quals rather than filter quals at that outer join. Instead, we should mark them nullable when they are pulled out and ready to be added to the targetlist, if they are really needed in the targetlist. Thanks Richard
Commits
-
Fix wrong varnullingrels error for MERGE WHEN NOT MATCHED BY SOURCE.
- 259a0a99fe3d 18.0 landed
- 34ae54af92e0 17.1 landed
-
Fix incorrect non-strict join recheck in MERGE WHEN NOT MATCHED BY SOURCE.
- dddb5640c6d3 18.0 landed
- d7d297f84496 17.1 landed