Commit faee5a12 authored by Tom Lane's avatar Tom Lane

Back off output precision in circle.sql regression test.

We were setting extra_float_digits = 0 to avoid platform-dependent
output in this test, but that's still able to expose platform-specific
roundoff behavior in some new test cases added by commit a3d28448,
as reported by Peter Eisentraut.  Reduce it to -1 to hide that.

(Over in geometry.sql, we're using -3, which is an ancient decision
dating to 337f73b1.  I wonder whether that's overkill now.  But
there's probably little value in trying to change it.)

Back-patch to v12 where a3d28448 came in; there's no evidence that
we have any platform-dependent issues here before that.

Discussion: https://postgr.es/m/15551268-e224-aa46-084a-124b64095ee3@2ndquadrant.com
parent f493d98c
-- --
-- CIRCLE -- CIRCLE
-- --
-- avoid bit-exact output here because operations may not be bit-exact. -- Back off displayed precision a little bit to reduce platform-to-platform
-- variation in results.
SET extra_float_digits = -1;
CREATE TABLE CIRCLE_TBL (f1 circle); CREATE TABLE CIRCLE_TBL (f1 circle);
INSERT INTO CIRCLE_TBL VALUES ('<(5,1),3>'); INSERT INTO CIRCLE_TBL VALUES ('<(5,1),3>');
INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>'); INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
...@@ -113,12 +114,12 @@ SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance ...@@ -113,12 +114,12 @@ SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance
five | one | two | distance five | one | two | distance
------+----------------+----------------+------------------ ------+----------------+----------------+------------------
| <(3,5),0> | <(1,2),3> | 0.60555127546399 | <(3,5),0> | <(1,2),3> | 0.60555127546399
| <(3,5),0> | <(5,1),3> | 1.47213595499958 | <(3,5),0> | <(5,1),3> | 1.4721359549996
| <(100,200),10> | <(100,1),115> | 74 | <(100,200),10> | <(100,1),115> | 74
| <(100,200),10> | <(1,2),100> | 111.370729772479 | <(100,200),10> | <(1,2),100> | 111.37072977248
| <(1,3),5> | <(100,200),10> | 205.476756144497 | <(1,3),5> | <(100,200),10> | 205.4767561445
| <(5,1),3> | <(100,200),10> | 207.51303816328 | <(5,1),3> | <(100,200),10> | 207.51303816328
| <(3,5),0> | <(100,200),10> | 207.793480159531 | <(3,5),0> | <(100,200),10> | 207.79348015953
| <(1,2),3> | <(100,200),10> | 208.370729772479 | <(1,2),3> | <(100,200),10> | 208.37072977248
(8 rows) (8 rows)
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
-- CIRCLE -- CIRCLE
-- --
-- avoid bit-exact output here because operations may not be bit-exact. -- Back off displayed precision a little bit to reduce platform-to-platform
-- variation in results.
SET extra_float_digits = -1;
CREATE TABLE CIRCLE_TBL (f1 circle); CREATE TABLE CIRCLE_TBL (f1 circle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment