On Sun, Mar 14, 2021 at 1:52 PM wangsh.f...@fujitsu.com
<wangsh.f...@fujitsu.com> wrote:
>
> Hi,
>
> I noticed in patch 
> v58-0001-Add-support-for-apply-at-prepare-time-to-built-i.patch
>
> > +static void
> > +prepare_spoolfile_name(char *path, int szpath, Oid subid, char *gid)
> > +{
> > +     PsfHashEntry *hentry;
> > +
> > +     /*
> > +      * This name is used as the key in the psf_hash HTAB. Therefore, the 
> > name
> > +      * and the key must be exactly same lengths and padded with '\0' so
> > +      * garbage does not impact the HTAB lookups.
> > +      */
> > +     Assert(sizeof(hentry->name) == MAXPGPATH);
> > +     Assert(szpath == MAXPGPATH);
> > +     memset(path, '\0', MAXPGPATH);
> > +
> > +     snprintf(path, MAXPGPATH, "%s/psf_%u_%s.changes", PSF_DIR, subid, 
> > gid);
> > +}
>
> The variable hentry is only used when --enable-cassert is specified, it will 
> be a warning if I don't specify the
> --enable-cassert when execute configure
>
> And the comment says the lengths are same, I think ' 
> Assert(sizeof(hentry->name) == szpath) ' will be better.
>

Thanks for your feedback comment.

But today Amit suggested [ak0315] that the current psf logic should
all be replaced, after which the function you commented about will no
longer exist.

----
[ak0315] 
https://www.postgresql.org/message-id/CAA4eK1LVEdPYnjdajYzu3k6KEii1%2BF0jdQ6sWnYugiHcSGZD6Q%40mail.gmail.com

Kind Regards,
Peter Smith.
Fujitsu Australia


Reply via email to