pgsql: Fix an oversight in commit 4c70098ff.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix an oversight in commit 4c70098ff.
Date: 2020-01-23 21:15:59
Message-ID: E1iujpX-0006hT-Oh@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix an oversight in commit 4c70098ff.

I had supposed that the from_char_seq_search() call sites were
all passing the constant arrays you'd expect them to pass ...
but on looking closer, the one for DY format was passing the
days[] array not days_short[]. This accidentally worked because
the day abbreviations in English are all the same as the first
three letters of the full day names. However, once we took out
the "maximum comparison length" logic, it stopped working.

As penance for that oversight, add regression test cases covering
this, as well as every other switch case in DCH_from_char() that
was not reached according to the code coverage report.

Also, fold the DCH_RM and DCH_rm cases into one --- now that
seq_search is case independent, there's no need to pass different
comparison arrays for those cases.

Back-patch, as the previous commit was.

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7a9fef2990174cc8315eb20372afb1557e5cb01a

Modified Files
--------------
src/backend/utils/adt/formatting.c | 6 +---
src/test/regress/expected/horology.out | 63 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/horology.sql | 19 ++++++++++
3 files changed, 83 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-01-23 23:21:01 pgsql: Add configure probe for rl_completion_suppress_quote.
Previous Message Robert Haas 2020-01-23 20:49:37 Re: pgsql: walreceiver uses a temporary replication slot by default