]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix an oversight in commit 4c70098ff.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Jan 2020 21:15:32 +0000 (16:15 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Jan 2020 21:15:32 +0000 (16:15 -0500)
commit0e63d9641bad3f50f91ee8e351051bddabac8d31
treef48e4b2170edf84a9a4ff39f0d4125d616d748ab
parenta576f2a8f2e8a07b35b66c15477e510baa462dec
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.
src/backend/utils/adt/formatting.c
src/test/regress/expected/horology.out
src/test/regress/sql/horology.sql