Fix setrefs.c code for Result Cache nodes

David Rowley <drowley@postgresql.org>

Commit: cba5c70b956810c61b3778f7041f92fbb8065acb
Author: David Rowley <drowley@postgresql.org>
Date: 2021-05-25T00:50:22Z
Releases: 14.0
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

Files

PathChange+/−
src/backend/optimizer/plan/setrefs.c modified +6 −0
src/test/regress/expected/join.out modified +13 −13

Discussion