Skip to content

Commit 01fc25f

Browse files
committed
Un-break ecpg test suite under --disable-integer-datetimes.
Commit 4318dae 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.
1 parent be78305 commit 01fc25f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static char *times[] = { "0:04",
6161
"1:59 PDT",
6262
"13:24:40 -8:00",
6363
"13:24:40.495+3",
64-
"13:24:40.123456789+3",
64+
"13:24:40.123456123+3",
6565
NULL };
6666

6767
char *intervals[] = { "1 minute",
@@ -145,7 +145,8 @@ main(void)
145145
sprintf(t, "%s %s", dates[i], times[j]);
146146
ts1 = PGTYPEStimestamp_from_asc(t, NULL);
147147
text = PGTYPEStimestamp_to_asc(ts1);
148-
if (i != 19 || j != 3) /* timestamp as integer or double differ for this case */
148+
/* skip outputs sensitive to USE_INTEGER_DATETIMES */
149+
if (i != 19 || (j != 3 && j != 4))
149150
printf("TS[%d,%d]: %s\n",
150151
i, j, errno ? "-" : text);
151152
free(text);

src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ Date[19]: 0099-01-08 BC (N - F)
103103
TS[19,0]: 0099-01-08 00:04:00 BC
104104
TS[19,1]: 0099-01-08 01:59:00 BC
105105
TS[19,2]: 0099-01-08 13:24:40 BC
106-
TS[19,4]: 0099-01-08 13:24:40.123456 BC
107106
Date[20]: - (N - T)
108107
Date[21]: - (N - T)
109108
interval[0]: @ 1 min

src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static char *times[] = { "0:04",
4343
"1:59 PDT",
4444
"13:24:40 -8:00",
4545
"13:24:40.495+3",
46-
"13:24:40.123456789+3",
46+
"13:24:40.123456123+3",
4747
NULL };
4848

4949
char *intervals[] = { "1 minute",
@@ -110,7 +110,8 @@ main(void)
110110
sprintf(t, "%s %s", dates[i], times[j]);
111111
ts1 = PGTYPEStimestamp_from_asc(t, NULL);
112112
text = PGTYPEStimestamp_to_asc(ts1);
113-
if (i != 19 || j != 3) /* timestamp as integer or double differ for this case */
113+
/* skip outputs sensitive to USE_INTEGER_DATETIMES */
114+
if (i != 19 || (j != 3 && j != 4))
114115
printf("TS[%d,%d]: %s\n",
115116
i, j, errno ? "-" : text);
116117
free(text);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy