Re: pgsql: Deduplicate choice of horizon for a relation procarray.c.

From: Andres Freund <andres(at)anarazel(dot)de>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Deduplicate choice of horizon for a relation procarray.c.
Date: 2021-09-14 00:01:53
Message-ID: 20210914000153.vpuglpeeufomskjn@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi,

On 2021-08-27 18:46:39 -0400, Stephen Frost wrote:
> * Andres Freund (andres(at)anarazel(dot)de) wrote:
> > As the code in question was only introduced in dc7420c2c92 it seems worth
> > backpatching this change as well, otherwise 14 will look different from all
> > other branches.
>
> Interestingly, these patches ended up actually introducing a difference
> between 14 and master in the form of:
>
> GlobalVisTestFor(Relation rel)
>
> - GlobalVisState *state;
> + GlobalVisState *state = NULL;
>
> being done on master but not in the 14 stable branch, leading to, at
> least for me:
>
> .../src/backend/storage/ipc/procarray.c: In function ‘GlobalVisTestFor’:
> .../src/backend/storage/ipc/procarray.c:4054:9: warning: ‘state’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> 4054 | return state;
> | ^~~~~
>
> Seems like we should include that change in 14 too, to get rid of the
> above warning and to make that bit of code the same too..?

Done! Stupid oversight :(

Greetings,

Andres Freund

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-09-14 01:16:15 pgsql: Remove code duplication for permission checks with replication s
Previous Message Andres Freund 2021-09-14 00:01:38 pgsql: Fix potential for compiler warning in GlobalVisTestFor().

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-09-14 00:08:47 Re: Estimating HugePages Requirements?
Previous Message Fabrízio de Royes Mello 2021-09-13 23:31:34 Re: Is SPI + Procedures (with COMMIT) inside a bgworker broken?