Fix "wrong varnullingrels" for Memoize's lateral references, too.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 13 Jun 2023 22:01:33 +0000 (18:01 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 13 Jun 2023 22:01:33 +0000 (18:01 -0400)
commit63e4f13d2a78124c798165814a679b0534db87a5
treed8f62020c51f63d2a2ad6b6c3f73512a24a26ceb
parent792213f2e9f6d321d5a463f4a0fc263c2b770ac3
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
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/plan/setrefs.c
src/test/regress/expected/join.out
src/test/regress/sql/join.sql