git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c3a24e3)
Secondary patch to fix interval to_char() for "HH" where hours >= 12.
2010年2月23日 06:29:01 +0000 (06:29 +0000)
2010年2月23日 06:29:01 +0000 (06:29 +0000)

diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 1db285536fef9b78078da1c5556709cbeeb606ff..a41f6f1496b65dd3debcebcb1338683ede761d6b 100644 (file)
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
* formatting.c
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.164 2010年02月23日 01:42:19 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.165 2010年02月23日 06:29:01 momjian Exp $
*
*
* Portions Copyright (c) 1999-2010, PostgreSQL Global Development Group
@@ -2089,7 +2089,8 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
case DCH_HH:
case DCH_HH12:
sprintf(s, "%0*d", S_FM(n->suffix) ? 0 : 2,
- !is_interval && tm->tm_hour % (HOURS_PER_DAY / 2) == 0 ?
+ is_interval ? tm->tm_hour :
+ tm->tm_hour % (HOURS_PER_DAY / 2) == 0 ?
12 : tm->tm_hour % (HOURS_PER_DAY / 2));
if (S_THth(n->suffix))
str_numth(s, s, S_TH_TYPE(n->suffix));
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /