Fix setrefs.c code for Result Cache nodes
authorDavid Rowley
Tue, 25 May 2021 00:50:22 +0000 (12:50 +1200)
committerDavid Rowley
Tue, 25 May 2021 00:50:22 +0000 (12:50 +1200)
commitcba5c70b956810c61b3778f7041f92fbb8065acb
tree19632f4af0804aa1e7d48032a03abbc7c08d296b
parentc242baa4a831ac2e7dcaec85feb410aefa3a996e
Fix setrefs.c code for Result Cache nodes

Result Cache, added in 9eacee2e6 neglected to properly adjust the plan
references in setrefs.c.  This could lead to the following error during
EXPLAIN:

ERROR:  cannot decompile join alias var in plan tree

Fix that.

Bug: 17030
Reported-by: Hans Buschmann
Discussion: https://postgr.es/m/17030-5844aecae42fe223@postgresql.org
src/backend/optimizer/plan/setrefs.c
src/test/regress/expected/join.out