pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Clean up parsing of ltree and lquery some more.
Date: Wed, 01 Apr 2020 23:44:29 +0000
Message-ID: <E1jJn25-0005xW-CP@gemulon.postgresql.org> (raw)

Clean up parsing of ltree and lquery some more.

Fix lquery parsing to handle repeated flag characters correctly,
and to enforce the max label length correctly in some cases where
it did not before, and to detect empty labels in some cases where
it did not before.

In a more cosmetic vein, use a switch rather than if-then chains to
handle the different states, and avoid unnecessary checks on charlen
when looking for ASCII characters, and factor out multiple copies of
the label length checking code.

Tom Lane and Dmitry Belyavsky

Discussion: https://postgr.es/m/CADqLbzLVkBuPX0812o+z=c3i6honszsZZ6VQOSKR3VPbB56P3w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/17ca067995114ee40749d9138ba85fdd68518052

Modified Files
--------------
contrib/ltree/expected/ltree.out |  98 ++++++++
contrib/ltree/ltree_io.c         | 515 ++++++++++++++++++---------------------
contrib/ltree/sql/ltree.sql      |  27 ++
3 files changed, 362 insertions(+), 278 deletions(-)



Message-ID: <E1jJn25-0005xW-CP@gemulon.postgresql.org>
Permalink:  ../E1jJn25-0005xW-CP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jJn25-0005xW-CP@gemulon.postgresql.org

 · 

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 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: Clean up parsing of ltree and lquery some more.
  In-Reply-To: <E1jJn25-0005xW-CP@gemulon.postgresql.org>
  References: <E1jJn25-0005xW-CP@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