Make replace_relid() leave argument unmodified

Alexander Korotkov <akorotkov@postgresql.org>

Commit: e0477837ce49d73c9f21a5e00143b741ce6e1f89
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date: 2023-12-27T01:57:57Z
Releases: 17.0
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

Files

Discussion