From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove useless character-length checks in contrib/ltree.
Date: Thu, 06 Oct 2022 15:18:50 +0000
Message-ID: <E1ogSe9-001AsT-Dp@gemulon.postgresql.org> (raw)
Remove useless character-length checks in contrib/ltree.
The t_iseq() macro does not need to be guarded by a character
length check (at least when the comparison value is an ASCII
character, as its documentation requires). Some portions of
contrib/ltree hadn't read that memo, so simplify them.
The last change in gettoken_query,
- else if (charlen == 1 && !t_iseq(state->buf, ' '))
+ else if (!t_iseq(state->buf, ' '))
looks like it's actually a bug fix: I doubt that the intention
was to silently ignore multibyte characters as if they were
whitespace. I'm not tempted to back-patch though, because this
will have the effect of tightening what is allowed in ltxtquery
strings.
Discussion: https://postgr.es/m/2548310.1664999615@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/58640f37d9acf632a4dd60d140f36f2e6815f716
Modified Files
--------------
contrib/ltree/lquery_op.c | 9 ++++-----
contrib/ltree/ltree.h | 2 +-
contrib/ltree/ltxtquery_io.c | 16 ++++++++--------
3 files changed, 13 insertions(+), 14 deletions(-)
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-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Remove useless character-length checks in contrib/ltree.
In-Reply-To: <E1ogSe9-001AsT-Dp@gemulon.postgresql.org>
References: <E1ogSe9-001AsT-Dp@gemulon.postgresql.org>
* 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