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: Fix handling of format string text characters in to_timestamp()/
Date: Thu, 20 Sep 2018 12:51:39 +0000
Message-ID: <E1g2yQl-0004Ia-7R@gemulon.postgresql.org> (raw)

Fix handling of format string text characters in to_timestamp()/to_date()

cf984672 introduced improvement of handling of spaces and separators in
to_timestamp()/to_date() functions.  In particular, now we're skipping spaces
both before and after fields.  That may cause format string text character to
consume part of field in the situations, when it didn't happen before cf984672.
This commit cause format string text character consume input string characters
only when since previous field (or string beginning) number of skipped input
string characters is not greater than number of corresponding format string
characters (that is we didn't skip any extra characters in input string).

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/09e99ce86e3dfb4716618b1dda4074b45ba56a09

Modified Files
--------------
src/backend/utils/adt/formatting.c     | 19 +++++++++++++++++--
src/test/regress/expected/horology.out | 15 +++++++++++++++
src/test/regress/sql/horology.sql      |  4 ++++
3 files changed, 36 insertions(+), 2 deletions(-)



Message-ID: <E1g2yQl-0004Ia-7R@gemulon.postgresql.org>
Permalink:  ../E1g2yQl-0004Ia-7R@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1g2yQl-0004Ia-7R@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: Fix handling of format string text characters in to_timestamp()/
  In-Reply-To: <E1g2yQl-0004Ia-7R@gemulon.postgresql.org>
  References: <E1g2yQl-0004Ia-7R@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