Fix incorrect hash equality operator bug in Memoize
authorDavid Rowley <drowley@postgresql.org>
Mon, 8 Nov 2021 01:40:33 +0000 (14:40 +1300)
committerDavid Rowley <drowley@postgresql.org>
Mon, 8 Nov 2021 01:40:33 +0000 (14:40 +1300)
commit39a3105678a247bbfdc132cd95db5b515b8cd7f6
tree3267d3ecbefa5306f13682c927b828155f112ada
parente2fbb883720aa222f61eb9f3affad1c63bac7cbb
Fix incorrect hash equality operator bug in Memoize

In v14, because we don't have a field in RestrictInfo to cache both the
left and right type's hash equality operator, we just restrict the scope
of Memoize to only when the left and right types of a RestrictInfo are the
same.

In master we add another field to RestrictInfo and cache both hash
equality operators.

Reported-by: Jaime Casanova
Author: David Rowley
Discussion: https://postgr.es/m/20210929185544.GB24346%40ahch-to
Backpatch-through: 14
src/backend/nodes/copyfuncs.c
src/backend/nodes/outfuncs.c
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/plan/initsplan.c
src/backend/optimizer/util/restrictinfo.c
src/include/nodes/pathnodes.h