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: 22f0303)
Back out part of patch that should be applied later.
2005年5月27日 15:16:45 +0000 (15:16 +0000)
2005年5月27日 15:16:45 +0000 (15:16 +0000)

diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index f7274c037d35e0ef3874154ffc0bc9d8b177aa2b..53026363a13135978322dff203560665e1ce5428 100644 (file)
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.148 2005年05月27日 15:15:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.149 2005年05月27日 15:16:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3461,9 +3461,12 @@ EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, int *tzp, int style, char *str)
#ifdef HAVE_INT64_TIMESTAMP
sprintf(str + strlen(str), ":%02d.%06d", tm->tm_sec, fsec);
#else
- sprintf(str + strlen(str), ":%012.9f", tm->tm_sec + fsec);
+ sprintf(str + strlen(str), ":%013.10f", tm->tm_sec + fsec);
#endif
- TrimTrailingZeros(str);
+ /* chop off trailing pairs of zeros... */
+ while (strcmp((str + strlen(str) - 2), "00") == 0 &&
+ *(str + strlen(str) - 3) != '.')
+ *(str + strlen(str) - 2) = '0円';
}
else
sprintf(str + strlen(str), ":%02d", tm->tm_sec);
@@ -3801,7 +3804,7 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str)
sprintf(cp, ".%06d", Abs(fsec));
#else
fsec += tm->tm_sec;
- sprintf(cp, ":%012.9f", fabs(fsec));
+ sprintf(cp, ":%013.10f", fabs(fsec));
#endif
TrimTrailingZeros(cp);
cp += strlen(cp);
diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c
index a5e9673b10d147aed0a3803f15fd89abfe626538..f5b2b2573f2e237765eb1cfb4c2f05e68669dfc2 100644 (file)
--- a/src/interfaces/ecpg/pgtypeslib/interval.c
+++ b/src/interfaces/ecpg/pgtypeslib/interval.c
@@ -511,7 +511,7 @@ EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str)
sprintf(cp, ".%06d", Abs(fsec));
#else
fsec += tm->tm_sec;
- sprintf(cp, ":%012.9f", fabs(fsec));
+ sprintf(cp, ":%013.10f", fabs(fsec));
#endif
TrimTrailingZeros(cp);
cp += strlen(cp);
diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out
index c0a7f6e5b83c6206e782d1c834d4e5e655aaa1b2..ca8bc3d0e5ca536d80a11a7cdb2eb4e4e28441fc 100644 (file)
--- a/src/test/regress/expected/horology.out
+++ b/src/test/regress/expected/horology.out
@@ -205,62 +205,62 @@ SET DateStyle = 'ISO';
-- As of 7.4, allow time without time zone having a time zone specified
SELECT time without time zone '040506.789+08';
time
---------------
- 04:05:06.789
+---------------
+ 04:05:06.7890
(1 row)
SELECT time without time zone '040506.789-08';
time
---------------
- 04:05:06.789
+---------------
+ 04:05:06.7890
(1 row)
SELECT time without time zone 'T040506.789+08';
time
---------------
- 04:05:06.789
+---------------
+ 04:05:06.7890
(1 row)
SELECT time without time zone 'T040506.789-08';
time
---------------
- 04:05:06.789
+---------------
+ 04:05:06.7890
(1 row)
SELECT time with time zone '040506.789+08';
timetz
------------------
- 04:05:06.789+08
+------------------
+ 04:05:06.7890+08
(1 row)
SELECT time with time zone '040506.789-08';
timetz
------------------
- 04:05:06.789-08
+------------------
+ 04:05:06.7890-08
(1 row)
SELECT time with time zone 'T040506.789+08';
timetz
------------------
- 04:05:06.789+08
+------------------
+ 04:05:06.7890+08
(1 row)
SELECT time with time zone 'T040506.789-08';
timetz
------------------
- 04:05:06.789-08
+------------------
+ 04:05:06.7890-08
(1 row)
SELECT time with time zone 'T040506.789 +08';
timetz
------------------
- 04:05:06.789+08
+------------------
+ 04:05:06.7890+08
(1 row)
SELECT time with time zone 'T040506.789 -08';
timetz
------------------
- 04:05:06.789-08
+------------------
+ 04:05:06.7890-08
(1 row)
SET DateStyle = 'Postgres, MDY';
This is the main PostgreSQL git repository.
RSS Atom

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