1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-09 17:03:00 +03:00

Fix ancient bug in handling of to_char modifier 'TH', when used with HH.

In what seems like an oversight, we used to treat 'TH' the same as lowercase
'th', but only with HH/HH12.
This commit is contained in:
Heikki Linnakangas
2009-07-06 19:11:53 +00:00
parent e3eb8f6cc2
commit 96ee4c9726

View File

@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
* formatting.c * formatting.c
* *
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.137.2.1 2009/03/12 00:53:32 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.137.2.2 2009/07/06 19:11:53 heikki Exp $
* *
* *
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
@@ -1913,7 +1913,7 @@ dch_time(int arg, char *inout, int suf, bool is_to_char, bool is_interval,
tm->tm_hour % (HOURS_PER_DAY / 2) == 0 ? 12 : tm->tm_hour % (HOURS_PER_DAY / 2) == 0 ? 12 :
tm->tm_hour % (HOURS_PER_DAY / 2)); tm->tm_hour % (HOURS_PER_DAY / 2));
if (S_THth(suf)) if (S_THth(suf))
str_numth(p_inout, inout, 0); str_numth(p_inout, inout, S_TH_TYPE(suf));
return strlen(p_inout); return strlen(p_inout);
} }
else else