Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-13 Thread Tomas Vondra
On 4/12/21 7:04 PM, Tom Lane wrote: > Ranier Vilela writes: >> Em seg., 12 de abr. de 2021 às 03:04, Tom Lane escreveu: >>> It would be wrong, though, or at least not have the same effect. > >> I think that you speak about fill pointers with 0 is not the same as fill >> pointers with NULL. >

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-12 Thread Justin Pryzby
On Mon, Apr 12, 2021 at 01:55:13PM -0300, Ranier Vilela wrote: > Em seg., 12 de abr. de 2021 às 03:04, Tom Lane escreveu: > > Michael Paquier writes: > > > On Sun, Apr 11, 2021 at 07:42:20PM -0300, Ranier Vilela wrote: > > >> Em dom., 11 de abr. de 2021 às 16:25, Justin Pryzby < > > pry...@telsas

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-12 Thread Tom Lane
Ranier Vilela writes: > Em seg., 12 de abr. de 2021 às 03:04, Tom Lane escreveu: >> It would be wrong, though, or at least not have the same effect. > I think that you speak about fill pointers with 0 is not the same as fill > pointers with NULL. No, I mean that InvalidBlockNumber isn't 0. > I

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-12 Thread Tomas Vondra
On 4/12/21 6:55 PM, Ranier Vilela wrote: > > > Em seg., 12 de abr. de 2021 às 03:04, Tom Lane > escreveu: > > Michael Paquier mailto:mich...@paquier.xyz>> > writes: > > On Sun, Apr 11, 2021 at 07:42:20PM -0300, Ranier Vilela wrote: > >> Em dom., 11

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-12 Thread Ranier Vilela
Em seg., 12 de abr. de 2021 às 03:04, Tom Lane escreveu: > Michael Paquier writes: > > On Sun, Apr 11, 2021 at 07:42:20PM -0300, Ranier Vilela wrote: > >> Em dom., 11 de abr. de 2021 às 16:25, Justin Pryzby < > pry...@telsasoft.com> > >>> I think it's cleanest to write: > >>> |HeapTupleData tmpt

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-11 Thread Tom Lane
Michael Paquier writes: > On Sun, Apr 11, 2021 at 07:42:20PM -0300, Ranier Vilela wrote: >> Em dom., 11 de abr. de 2021 às 16:25, Justin Pryzby >>> I think it's cleanest to write: >>> |HeapTupleData tmptup = {0}; > I agree that this would be cleaner. It would be wrong, though, or at least not h

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-11 Thread Michael Paquier
On Sun, Apr 11, 2021 at 07:42:20PM -0300, Ranier Vilela wrote: > Em dom., 11 de abr. de 2021 às 16:25, Justin Pryzby > escreveu: >> I think you're right. You can look in the commit history to find the >> relevant >> commit and copy the committer. In this case that's a4d75c8, for Tomas. >> I thi

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-11 Thread Ranier Vilela
Hi Justin, sorry for the delay. Nothing against it, but I looked for similar codes and this is the usual way to initialize HeapTupleData. Perhaps InvalidOid makes a difference. regards, Ranier Vilela Em dom., 11 de abr. de 2021 às 16:25, Justin Pryzby escreveu: > On Sun, Apr 11, 2021 at 03:38

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-11 Thread Justin Pryzby
On Sun, Apr 11, 2021 at 03:38:10PM -0300, Ranier Vilela wrote: > Per Coverity. > > It seems to me that some recent commit has failed to properly initialize a > structure, in extended_stats.c, when is passed to heap_copytuple. I think you're right. You can look in the commit history to find the r

Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-11 Thread Ranier Vilela
Hi, Per Coverity. It seems to me that some recent commit has failed to properly initialize a structure, in extended_stats.c, when is passed to heap_copytuple. regards, Ranier Vilela fix_uninitialized_var_extend_stats.patch Description: Binary data