Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)
Date
Msg-id CAEudQAo4OjwizXX9+drxYmVH3NjRjLReTePcbaw_uXS82AdrHA@mail.gmail.com
Whole thread Raw
In response to Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
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 <pryzby@telsasoft.com> escreveu:
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 relevant
commit and copy the committer.

I think it's cleanest to write:
|HeapTupleData tmptup = {0};

--
Justin

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Possible SSI bug in heap_update
Next
From: Thomas Munro
Date:
Subject: Re: Calendar support in localization