]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix ancient bug in handling of to_char modifier 'TH', when used with HH.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 6 Jul 2009 19:12:06 +0000 (19:12 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 6 Jul 2009 19:12:06 +0000 (19:12 +0000)
In what seems like an oversight, we used to treat 'TH' the same as lowercase
'th', but only with HH/HH12.

src/backend/utils/adt/formatting.c

index 58e299663a0f1f83f4ce4ea43c90cd3c4113b17c..9b8b6dc667926c5f8d0ad5bcd67c789b982c181e 100644 (file)
@@ -1,7 +1,7 @@
 /* -----------------------------------------------------------------------
  * formatting.c
  *
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.101.2.5 2009/03/12 00:53:48 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.101.2.6 2009/07/06 19:12:06 heikki Exp $
  *
  *
  *      Portions Copyright (c) 1999-2005, PostgreSQL Global Development Group
@@ -1809,7 +1809,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));
                                if (S_THth(suf))
-                                       str_numth(p_inout, inout, 0);
+                                       str_numth(p_inout, inout, S_TH_TYPE(suf));
                                return strlen(p_inout);
                        }
                        else