pgsql: Fix to_timestamp/to_date's handling of consecutive spaces in for

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix to_timestamp/to_date's handling of consecutive spaces in for
Date: 2014-01-20 18:45:58
Message-ID: E1W5JrC-0007d4-U5@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix to_timestamp/to_date's handling of consecutive spaces in format string.

When there are consecutive spaces (or other non-format-code characters) in
the format, we should advance over exactly that many characters of input.
The previous coding mistakenly did a "skip whitespace" action between such
characters, possibly allowing more input to be skipped than the user
intended. We only need to skip whitespace just before an actual field.

This is really a bug fix, but given the minimal number of field complaints
and the risk of breaking applications coded to expect the old behavior,
let's not back-patch it.

Jeevan Chalke

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9a8f5729b4625ec0468ad5a48296c3e729cf3e65

Modified Files
--------------
src/backend/utils/adt/formatting.c | 18 +++++---
src/test/regress/expected/horology.out | 75 ++++++++++++++++++++++++++++++++
src/test/regress/sql/horology.sql | 20 +++++++++
3 files changed, 107 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-01-20 20:04:05 pgsql: Remove pg_stat_statements--1.1.sql.
Previous Message Fujii Masao 2014-01-20 17:25:51 pgsql: Fix typo in comment.