pgsql: Make replace_relid() leave argument unmodified

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make replace_relid() leave argument unmodified
Date: 2023-12-27 01:58:21
Message-ID: E1rIJBc-00C50g-I0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2023-12-27 06:33:06 pgsql: Fix typo and case in messages
Previous Message Alexander Korotkov 2023-12-27 01:58:20 pgsql: REALLOCATE_BITMAPSETS manual compile-time option