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

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
Subject: Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)
Date: 2021-04-11 22:42:20
Message-ID: CAEudQAo4OjwizXX9+drxYmVH3NjRjLReTePcbaw_uXS82AdrHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)telsasoft(dot)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
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-04-11 22:56:03 Re: Calendar support in localization
Previous Message Thomas Munro 2021-04-11 22:36:51 Re: Possible SSI bug in heap_update