From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: ranier_gyn@hotmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: [BUG FIX] Uninitialized var fargtypes used.
Date: Tue, 12 Nov 2019 17:10:46 -0300
Message-ID: <20191112201046.GA29021@alvherre.pgsql> (raw)
In-Reply-To: <6298.1573574830@sss.pgh.pa.us>
On 2019-Nov-12, Tom Lane wrote:
> If we're going to revert 0a52d378b03b we should just treat the
> problem straightforwardly. I was imagining
>
> - if (memcmp(argtypes, clist->args, nargs * sizeof(Oid)) == 0)
> + /* if nargs==0, argtypes can be null; don't pass that to memcmp */
> + if (nargs == 0 ||
> + memcmp(argtypes, clist->args, nargs * sizeof(Oid)) == 0)
>
> It's really stretching credulity to imagine that one more test-and-branch
> in this loop costs anything worth noticing, especially compared to the
> costs of having built the list to begin with. So I'm now feeling that
> 0a52d378b03b was penny-wise and pound-foolish.
I pushed using that approach.
For a minute I thought that it should also test that clist->nargs also
equals 0, but that turns out not to be necessary since the number of
arguments is already considered by FuncnameGetCandidates above.
Thanks
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, horikyota.ntt@gmail.com, ranier_gyn@hotmail.com
Subject: Re: [BUG FIX] Uninitialized var fargtypes used.
In-Reply-To: <20191112201046.GA29021@alvherre.pgsql>
References: <6298.1573574830@sss.pgh.pa.us> <20191112201046.GA29021@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox