Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 08c8e89

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 1e81f84 commit 08c8e89

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

+3-2
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

-1
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

+3-2
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)