pgsql: Fix to_timestamp/to_date's handling of consecutive spaces in for - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix to_timestamp/to_date's handling of consecutive spaces in for
Date
Msg-id E1W5JrC-0007d4-U5@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Fujii Masao
Date:
Subject: pgsql: Fix typo in comment.
Next
From: Tom Lane
Date:
Subject: pgsql: Remove pg_stat_statements--1.1.sql.