diff options
author | Noah Misch <noah@leadboat.com> | 2014-05-08 19:29:02 -0400 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2014-05-08 19:29:02 -0400 |
commit | 08c8e8962f56c23c6799178d52d3b31350a0708f (patch) | |
tree | 3addeb89f670e787fb6dafca207e993b91c4a0bc /src | |
parent | 1e81f8462aceb07d520daaabdc999b879381bd12 (diff) | |
download | postgresql-08c8e8962f56c23c6799178d52d3b31350a0708f.tar.gz postgresql-08c8e8962f56c23c6799178d52d3b31350a0708f.zip |
Un-break ecpg test suite under --disable-integer-datetimes.
Commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b broke it. The change in
sub-second precision at extreme dates is normal. The inconsistent
truncation vs. rounding is essentially a bug, albeit a longstanding one.
Back-patch to 8.4, like the causative commit.
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c | 5 | ||||
-rw-r--r-- | src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout | 1 | ||||
-rw-r--r-- | src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c index 0ba1936f1db..4277c2615da 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c @@ -61,7 +61,7 @@ static char *times[] = { "0:04", "1:59 PDT", "13:24:40 -8:00", "13:24:40.495+3", - "13:24:40.123456789+3", + "13:24:40.123456123+3", NULL }; char *intervals[] = { "1 minute", @@ -145,7 +145,8 @@ main(void) sprintf(t, "%s %s", dates[i], times[j]); ts1 = PGTYPEStimestamp_from_asc(t, NULL); text = PGTYPEStimestamp_to_asc(ts1); - if (i != 19 || j != 3) /* timestamp as integer or double differ for this case */ + /* skip outputs sensitive to USE_INTEGER_DATETIMES */ + if (i != 19 || (j != 3 && j != 4)) printf("TS[%d,%d]: %s\n", i, j, errno ? "-" : text); free(text); diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout index 9a4587b498e..941bffbd815 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout @@ -103,7 +103,6 @@ Date[19]: 0099-01-08 BC (N - F) TS[19,0]: 0099-01-08 00:04:00 BC TS[19,1]: 0099-01-08 01:59:00 BC TS[19,2]: 0099-01-08 13:24:40 BC -TS[19,4]: 0099-01-08 13:24:40.123456 BC Date[20]: - (N - T) Date[21]: - (N - T) interval[0]: @ 1 min diff --git a/src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc b/src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc index a127dd93a66..0bd1fec109d 100644 --- a/src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc +++ b/src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc @@ -43,7 +43,7 @@ static char *times[] = { "0:04", "1:59 PDT", "13:24:40 -8:00", "13:24:40.495+3", - "13:24:40.123456789+3", + "13:24:40.123456123+3", NULL }; char *intervals[] = { "1 minute", @@ -110,7 +110,8 @@ main(void) sprintf(t, "%s %s", dates[i], times[j]); ts1 = PGTYPEStimestamp_from_asc(t, NULL); text = PGTYPEStimestamp_to_asc(ts1); - if (i != 19 || j != 3) /* timestamp as integer or double differ for this case */ + /* skip outputs sensitive to USE_INTEGER_DATETIMES */ + if (i != 19 || (j != 3 && j != 4)) printf("TS[%d,%d]: %s\n", i, j, errno ? "-" : text); free(text); |