postgresql/contrib/postgres_fdw
David Rowley e502150f7d Allow Memoize to operate in binary comparison mode
Memoize would always use the hash equality operator for the cache key
types to determine if the current set of parameters were the same as some
previously cached set.  Certain types such as floating points where -0.0
and +0.0 differ in their binary representation but are classed as equal by
the hash equality operator may cause problems as unless the join uses the
same operator it's possible that whichever join operator is being used
would be able to distinguish the two values.  In which case we may
accidentally return in the incorrect rows out of the cache.

To fix this here we add a binary mode to Memoize to allow it to the
current set of parameters to previously cached values by comparing
bit-by-bit rather than logically using the hash equality operator.  This
binary mode is always used for LATERAL joins and it's used for normal
joins when any of the join operators are not hashable.

Reported-by: Tom Lane
Author: David Rowley
Discussion: https://postgr.es/m/3004308.1632952496@sss.pgh.pa.us
Backpatch-through: 14, where Memoize was added
2021-11-24 10:06:59 +13:00
..
expected Allow Memoize to operate in binary comparison mode 2021-11-24 10:06:59 +13:00
sql Improve publication error messages 2021-11-17 14:40:38 +01:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
connection.c postgres_fdw: Move comments about elog level in (sub)abort cleanup. 2021-10-13 19:00:00 +09:00
deparse.c postgres_fdw: suppress casts on constants in limited cases. 2021-11-12 11:50:47 -05:00
option.c Improve HINT message that FDW reports when there are no valid options. 2021-10-27 00:46:52 +09:00
postgres_fdw--1.0--1.1.sql postgres_fdw: Add functions to discard cached connections. 2021-01-26 15:35:54 +09:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Fix null-pointer crash in postgres_fdw's conversion_error_callback. 2021-10-06 15:50:24 -04:00
postgres_fdw.control postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
postgres_fdw.h postgres_fdw: Allow application_name of remote connection to be set via GUC. 2021-09-07 12:27:30 +09:00
shippable.c Replace remaining uses of "whitelist". 2021-01-05 14:00:16 +13:00