Make replace_relid() leave argument unmodified There are a lot of situations when we share the same pointer to a Bitmapset structure across different places. In order to evade undesirable side effects replace_relid() function should always return a copy.
Reported-by: Richard Guo Discussion: https://postgr.es/m/CAMbWs4_wJthNtYBL%2BSsebpgF-5L2r5zFFk6xYbS0A78GKOTFHw%40mail.gmail.com Reviewed-by: Richard Guo, Andres Freund, Ashutosh Bapat, Andrei Lepikhov Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e0477837ce49d73c9f21a5e00143b741ce6e1f89 Modified Files -------------- src/backend/optimizer/plan/analyzejoins.c | 11 ++++++++--- src/test/regress/expected/join.out | 15 +++++++++++++++ src/test/regress/sql/join.sql | 6 ++++++ 3 files changed, 29 insertions(+), 3 deletions(-)