diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-06-13 18:01:33 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-06-13 18:01:33 -0400 |
commit | 63e4f13d2a78124c798165814a679b0534db87a5 (patch) | |
tree | d8f62020c51f63d2a2ad6b6c3f73512a24a26ceb /src/backend/optimizer/plan/setrefs.c | |
parent | 792213f2e9f6d321d5a463f4a0fc263c2b770ac3 (diff) |
Fix "wrong varnullingrels" for Memoize's lateral references, too.
The issue fixed in commit bfd332b3f can also bite Memoize plans,
because of the separate copies of lateral reference Vars made
by paraminfo_get_equal_hashops. Apply the same hacky fix there.
(In passing, clean up shaky grammar in the existing comments
for this function.)
Richard Guo
Discussion: https://postgr.es/m/CAMbWs4-krwk0Wbd6WdufMAupuou_Ua73ijQ4XQCr1Mb5BaVtKQ@mail.gmail.com
Diffstat (limited to 'src/backend/optimizer/plan/setrefs.c')
-rw-r--r-- | src/backend/optimizer/plan/setrefs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index 3585a703fbd..ec5552327fb 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -2289,11 +2289,11 @@ set_join_references(PlannerInfo *root, Join *join, int rtoffset) * the outer-join level at which they are used, Vars seen in the * NestLoopParam expression may have nullingrels that are just a * subset of those in the Vars actually available from the outer - * side. Another case that can cause that to happen is explained - * in the comments for process_subquery_nestloop_params. Not - * checking this exactly is a bit grotty, but the work needed to - * make things match up perfectly seems well out of proportion to - * the value. + * side. Lateral references can create the same situation, as + * explained in the comments for process_subquery_nestloop_params + * and paraminfo_get_equal_hashops. Not checking this exactly is + * a bit grotty, but the work needed to make things match up + * perfectly seems well out of proportion to the value. */ nlp->paramval = (Var *) fix_upper_expr(root, (Node *) nlp->paramval, |