pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedregression failure on master with --disable-integer-datetimes
6+ messages / 3 participants
[nested] [flat]
* regression failure on master with --disable-integer-datetimes
@ 2014-05-06 18:01 Jeff Davis <pgsql@j-davis.com>
2014-05-06 18:48 ` Re: regression failure on master with --disable-integer-datetimes Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Davis @ 2014-05-06 18:01 UTC (permalink / raw)
To: pgsql-bugs; +Cc: Noah Misch <noah@leadboat.com>
Introduced in commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b.
Attached regression failure and patch. It looks like we're no longer
running floating point timestamps on the buildfarm?
To make the output for float/integer timestamps the same, we either need
to remove the fractional seconds or reduce the number of hours.
It looks like the test is for maximum output length of an interval, so
it seems better to reduce the number of hours to one million, which is
what my patch does. It still loses 3 characters of output length, which
is a bit unfortunate given the purpose of the test, but it's better than
losing 7. I don't have a better idea.
Regards,
Jeff Davis
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Attachments: download all (2 files, .tar.gz)
regression.diffs (text/x-patch, 1.2K) download
*** /home/jdavis/wd/git/postgresql/src/test/regress/expected/interval.out 2014-04-29 16:12:58.207041718 -0700
--- /home/jdavis/wd/git/postgresql/src/test/regress/results/interval.out 2014-05-06 10:04:20.052642703 -0700
***************
*** 308,316 ****
-- test long interval output
select '100000000y 10mon -1000000000d -1000000000h -10min -10.000001s ago'::interval;
! interval
! -------------------------------------------------------------------------------------------
! @ 100000000 years 10 mons -1000000000 days -1000000000 hours -10 mins -10.000001 secs ago
(1 row)
-- test justify_hours() and justify_days()
--- 308,316 ----
-- test long interval output
select '100000000y 10mon -1000000000d -1000000000h -10min -10.000001s ago'::interval;
! interval
! ------------------------------------------------------------------------------------
! @ 100000000 years 10 mons -1000000000 days -1000000000 hours -10 mins -10 secs ago
(1 row)
-- test justify_hours() and justify_days()
======================================================================
float-test.patch (text/x-patch, 1.8K) download
*** a/src/test/regress/expected/interval.out
--- b/src/test/regress/expected/interval.out
***************
*** 307,316 **** select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31
(1 row)
-- test long interval output
! select '100000000y 10mon -1000000000d -1000000000h -10min -10.000001s ago'::interval;
! interval
! -------------------------------------------------------------------------------------------
! @ 100000000 years 10 mons -1000000000 days -1000000000 hours -10 mins -10.000001 secs ago
(1 row)
-- test justify_hours() and justify_days()
--- 307,316 ----
(1 row)
-- test long interval output
! select '100000000y 10mon -1000000000d -1000000h -10min -10.000001s ago'::interval;
! interval
! ----------------------------------------------------------------------------------------
! @ 100000000 years 10 mons -1000000000 days -1000000 hours -10 mins -10.000001 secs ago
(1 row)
-- test justify_hours() and justify_days()
*** a/src/test/regress/sql/interval.sql
--- b/src/test/regress/sql/interval.sql
***************
*** 109,115 **** select avg(f1) from interval_tbl;
select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
-- test long interval output
! select '100000000y 10mon -1000000000d -1000000000h -10min -10.000001s ago'::interval;
-- test justify_hours() and justify_days()
--- 109,115 ----
select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
-- test long interval output
! select '100000000y 10mon -1000000000d -1000000h -10min -10.000001s ago'::interval;
-- test justify_hours() and justify_days()
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: regression failure on master with --disable-integer-datetimes
2014-05-06 18:01 regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
@ 2014-05-06 18:48 ` Tom Lane <tgl@sss.pgh.pa.us>
2014-05-06 19:18 ` Re: regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2014-05-06 18:48 UTC (permalink / raw)
To: Jeff Davis <pgsql@j-davis.com>; +Cc: pgsql-bugs; Noah Misch <noah@leadboat.com>
Jeff Davis <pgsql@j-davis.com> writes:
> Introduced in commit 4318daecc959886d001a6e79c6ea853e8b1dfb4b.
> Attached regression failure and patch. It looks like we're no longer
> running floating point timestamps on the buildfarm?
Evidently :-(. Who wants to crank up an animal doing that?
> To make the output for float/integer timestamps the same, we either need
> to remove the fractional seconds or reduce the number of hours.
> It looks like the test is for maximum output length of an interval, so
> it seems better to reduce the number of hours to one million, which is
> what my patch does. It still loses 3 characters of output length, which
> is a bit unfortunate given the purpose of the test, but it's better than
> losing 7. I don't have a better idea.
Hm. As the test stands, it requires a float-timestamps implementation
to store a value of 3600000610.000001 seconds, which is 16 decimal digits
or about one more than can reliably be extracted from an IEEE float8.
At least for IEEE machines, I think we could remove just one digit
and it would work (or if not, that would say that some additional thought
needs to be put into the rounding behavior in interval_out).
However, removing *any* digits seems like it mostly defeats the point of
the test. Maybe we should just lose the test?
A different solution is to add a variant expected-output file, though
I'm not terribly thrilled with that answer.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: regression failure on master with --disable-integer-datetimes
2014-05-06 18:01 regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
2014-05-06 18:48 ` Re: regression failure on master with --disable-integer-datetimes Tom Lane <tgl@sss.pgh.pa.us>
@ 2014-05-06 19:18 ` Jeff Davis <pgsql@j-davis.com>
2014-05-06 19:37 ` Re: regression failure on master with --disable-integer-datetimes Tom Lane <tgl@sss.pgh.pa.us>
2014-05-06 19:39 ` Re: regression failure on master with --disable-integer-datetimes Noah Misch <noah@leadboat.com>
0 siblings, 2 replies; 6+ messages in thread
From: Jeff Davis @ 2014-05-06 19:18 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs; Noah Misch <noah@leadboat.com>
On Tue, 2014-05-06 at 14:48 -0400, Tom Lane wrote:
> Hm. As the test stands, it requires a float-timestamps implementation
> to store a value of 3600000610.000001 seconds, which is 16 decimal digits
The test value has 1e9 hours, which is 3.6e12 seconds, plus 6 more
digits for microseconds is 18 decimal digits. If, as you say, 15 digits
can be reliably extracted from a double, then we need to cut three zeros
(which matches my simple test of just removing zeros until it achieves
the microsecond precision).
> However, removing *any* digits seems like it mostly defeats the point of
> the test. Maybe we should just lose the test?
The reason I thought it might still have some value is because it would
have still caught the problem that 4318daec patched. But I'm fine with
removing it.
(Though, I should add a comment indicating that it's not testing the
true maximum length.)
> A different solution is to add a variant expected-output file, though
> I'm not terribly thrilled with that answer.
Nor am I.
Regards,
Jeff Davis
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: regression failure on master with --disable-integer-datetimes
2014-05-06 18:01 regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
2014-05-06 18:48 ` Re: regression failure on master with --disable-integer-datetimes Tom Lane <tgl@sss.pgh.pa.us>
2014-05-06 19:18 ` Re: regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
@ 2014-05-06 19:37 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 6+ messages in thread
From: Tom Lane @ 2014-05-06 19:37 UTC (permalink / raw)
To: Jeff Davis <pgsql@j-davis.com>; +Cc: pgsql-bugs; Noah Misch <noah@leadboat.com>
Jeff Davis <pgsql@j-davis.com> writes:
> On Tue, 2014-05-06 at 14:48 -0400, Tom Lane wrote:
>> Hm. As the test stands, it requires a float-timestamps implementation
>> to store a value of 3600000610.000001 seconds, which is 16 decimal digits
> The test value has 1e9 hours, which is 3.6e12 seconds, plus 6 more
> digits for microseconds is 18 decimal digits. If, as you say, 15 digits
> can be reliably extracted from a double, then we need to cut three zeros
> (which matches my simple test of just removing zeros until it achieves
> the microsecond precision).
Um. I fat-fingered the math somehow ... I think I might've
copied-and-pasted from your modified test rather than the original.
But the bad news there is that you have too: 3.6e12 has got 13
digits to the left of the decimal point, leaving only 2 that could
be reliably extracted to the right. The correct math, if I've not
messed up again, is that this is the seconds value that the test
is trying to store:
regression=# select 1000000000.0*3600 + 10*60 + 10.000001;
?column?
----------------------
3600000000610.000001
(1 row)
which cannot be reproduced by float8:
regression=# select '3600000000610.000001'::float8;
float8
---------------
3600000000610
(1 row)
If we trim digits to the left of the decimal point, we need to
get rid of 4 not 3:
regression=# select '360000000610.000001'::float8;
float8
--------------
360000000610
(1 row)
regression=# select '36000000610.000001'::float8;
float8
-------------
36000000610
(1 row)
regression=# select '3600000610.000001'::float8;
float8
------------
3600000610
(1 row)
regression=# select '360000610.000001'::float8;
float8
------------------
360000610.000001
(1 row)
If we instead trim digits at the right, we have to go down to just 2,
at least on my Linux/x86_64 platform:
regression=# select '3600000000610.001'::float8;
float8
---------------
3600000000610
(1 row)
regression=# select '3600000000610.01'::float8;
float8
------------------
3600000000610.01
(1 row)
which squares with the expectation that you get between 15 and 16
decimal digits of precision from a float8.
In short, your revised test might work for you but I think we'd
need to drop another zero to have much confidence of it working
everywhere.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: regression failure on master with --disable-integer-datetimes
2014-05-06 18:01 regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
2014-05-06 18:48 ` Re: regression failure on master with --disable-integer-datetimes Tom Lane <tgl@sss.pgh.pa.us>
2014-05-06 19:18 ` Re: regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
@ 2014-05-06 19:39 ` Noah Misch <noah@leadboat.com>
2014-05-08 02:57 ` Re: regression failure on master with --disable-integer-datetimes Noah Misch <noah@leadboat.com>
1 sibling, 1 reply; 6+ messages in thread
From: Noah Misch @ 2014-05-06 19:39 UTC (permalink / raw)
To: Jeff Davis <pgsql@j-davis.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs
On Tue, May 06, 2014 at 12:18:02PM -0700, Jeff Davis wrote:
> On Tue, 2014-05-06 at 14:48 -0400, Tom Lane wrote:
> > However, removing *any* digits seems like it mostly defeats the point of
> > the test. Maybe we should just lose the test?
>
> The reason I thought it might still have some value is because it would
> have still caught the problem that 4318daec patched. But I'm fine with
> removing it.
>
> (Though, I should add a comment indicating that it's not testing the
> true maximum length.)
I'm good with how you fixed it; losing three digits wouldn't be grave. I
might fix it like this instead:
inline patch 1: src/test/regress/sql/interval.sql (+3/-1 lines) download inline-1.patch
--- a/src/test/regress/sql/interval.sql
+++ b/src/test/regress/sql/interval.sql
@@ -111,3 +111,5 @@ select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31
-- test long interval output
-select '100000000y 10mon -1000000000d -1000000000h -10min -10.000001s ago'::interval;
+select '100000000y 10mon -1000000000d -1000000000h -10min -10.000001s ago'::interval::text IN
+('@ 100000000 years 10 mons -1000000000 days -1000000000 hours -10 mins -10.000001 secs ago',
+ '@ 100000000 years 10 mons -1000000000 days -1000000000 hours -10 mins -10 secs ago');
It seems I also broke the ecpg test suite under --disable-integer-datetimes.
I think (not tested) the fix is s/123456789/123456123/ in dt_test2.pgc,
because it rounds under float datetimes and truncates under integer datetimes.
> > A different solution is to add a variant expected-output file, though
> > I'm not terribly thrilled with that answer.
>
> Nor am I.
Agreed.
--
Noah Misch
EnterpriseDB http://www.enterprisedb.com
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: regression failure on master with --disable-integer-datetimes
2014-05-06 18:01 regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
2014-05-06 18:48 ` Re: regression failure on master with --disable-integer-datetimes Tom Lane <tgl@sss.pgh.pa.us>
2014-05-06 19:18 ` Re: regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
2014-05-06 19:39 ` Re: regression failure on master with --disable-integer-datetimes Noah Misch <noah@leadboat.com>
@ 2014-05-08 02:57 ` Noah Misch <noah@leadboat.com>
0 siblings, 0 replies; 6+ messages in thread
From: Noah Misch @ 2014-05-08 02:57 UTC (permalink / raw)
To: Jeff Davis <pgsql@j-davis.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs
On Tue, May 06, 2014 at 03:39:52PM -0400, Noah Misch wrote:
> It seems I also broke the ecpg test suite under --disable-integer-datetimes.
> I think (not tested) the fix is s/123456789/123456123/ in dt_test2.pgc,
> because it rounds under float datetimes and truncates under integer datetimes.
Besides that, one of the new combinations had the same insufficient-precision
problem that affected interval.sql. With your commit and the attached patch,
"make check-world" looks good under --disable-integer-datetimes.
--
Noah Misch
EnterpriseDB http://www.enterprisedb.com
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Attachments:
ecpg-check-float-date-v1.patch (text/plain, 2.4K) download
diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
index 0ba1936..4277c26 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 9a4587b..941bffb 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 a127dd9..0bd1fec 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);
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2014-05-08 02:57 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-05-06 18:01 regression failure on master with --disable-integer-datetimes Jeff Davis <pgsql@j-davis.com>
2014-05-06 18:48 ` Tom Lane <tgl@sss.pgh.pa.us>
2014-05-06 19:18 ` Jeff Davis <pgsql@j-davis.com>
2014-05-06 19:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2014-05-06 19:39 ` Noah Misch <noah@leadboat.com>
2014-05-08 02:57 ` Noah Misch <noah@leadboat.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox