public inbox for [email protected]
help / color / mirror / Atom feedFrom: Daniel Gustafsson <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Redundant strlen(query) in get_rel_infos
Date: Mon, 15 May 2023 10:05:49 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <ZGHjI/[email protected]>
References: <CAHut+PshfqoGfFz6joYVCdqt9uM-UO2RK+edD6mfFPx3OmUt1g@mail.gmail.com>
<ZFxt5a/[email protected]>
<[email protected]>
<ZGHjI/[email protected]>
> On 15 May 2023, at 09:45, Michael Paquier <[email protected]> wrote:
> On Thu, May 11, 2023 at 11:57:37AM +0200, Daniel Gustafsson wrote:
>> Looking at the snprintf sites made me remember a patchset I worked on last year
>> (but I don't remember if I ended up submitting); there is no need to build one
>> of the queries on the stack as it has no variables. The attached 0003 (which
>> needs a reindent of the query text) comes from that patchset. I think we
>> should do this regardless.
>
> Not sure that this is an improvement in itself as
> get_tablespace_paths() includes QUERY_ALLOC because
> executeQueryOrDie() does so, so this could become a problem if
> someones decides to copy-paste this code with a query becomes longer
> than QUERY_ALLOC once built? Perhaps that's not worth worrying,
We already have lots of invocations of executeQueryOrDie which doesn't pass via
a QUERY_ALLOC buffer so I don't see any risk with adding one more.
--
Daniel Gustafsson
view thread (2+ messages)
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Redundant strlen(query) in get_rel_infos
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox