pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor jsonpath's compareDatetime()
Date: Mon, 21 Oct 2019 20:11:38 +0000
Message-ID: <E1iMe1i-00082Y-5W@gemulon.postgresql.org> (raw)

Refactor jsonpath's compareDatetime()

This commit refactors come ridiculous coding in compareDatetime().  Also, it
provides correct cross-datatype comparison even when one of values overflows
during cast.  That eliminates dilemma on whether we should suppress overflow
errors during cast.

Reported-by: Tom Lane
Discussion: https://postgr.es/m/32308.1569455803%40sss.pgh.pa.us
Discussion: https://postgr.es/m/a5629d0c-8162-7559-16aa-0c8390d6ba5f%40postgrespro.ru
Author: Nikita Glukhov, Alexander Korotkov

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/52ad1e659967896ed153185328ffe806d69abcb6

Modified Files
--------------
src/backend/utils/adt/date.c                 |  40 ++--
src/backend/utils/adt/jsonpath_exec.c        | 262 +++++++++++++++++----------
src/backend/utils/adt/timestamp.c            |  31 ++--
src/include/utils/date.h                     |   4 +-
src/include/utils/timestamp.h                |   4 +-
src/test/regress/expected/jsonb_jsonpath.out |  37 ++--
src/test/regress/sql/jsonb_jsonpath.sql      |   3 +
7 files changed, 237 insertions(+), 144 deletions(-)



Message-ID: <E1iMe1i-00082Y-5W@gemulon.postgresql.org>
Permalink:  ../E1iMe1i-00082Y-5W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iMe1i-00082Y-5W@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: akorotkov@postgresql.org
  Subject: Re: pgsql: Refactor jsonpath's compareDatetime()
  In-Reply-To: <E1iMe1i-00082Y-5W@gemulon.postgresql.org>
  References: <E1iMe1i-00082Y-5W@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