Bug #38959 archive_gis fails due to rounding difference
Submitted: 22 Aug 2008 11:14 Modified: 12 May 2015 11:31
Reporter: Daniel Fischer Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:Celosia (M3), 6.0 OS:Solaris (x86)
Assigned to: Assigned Account CPU Architecture:Any

[22 Aug 2008 11:14] Daniel Fischer
Description:
The archive_gis test case can fail due to a difference in rounding. This binary was built with gcc 3.4.5 on Solaris 10 x86_64.

main.archive_gis [ fail ]

--- /export/home/pb2/test/sourcebuilder-build-4940-1219357808.52/mysql-6.0.7-alpha-solaris10-i386-test/mysql-test/r/archive_gis.result	Fri Aug 22 00:04:15 2008
+++ /export/home/pb2/test/sourcebuilder-build-4940-1219357808.52/mysql-6.0.7-alpha-solaris10-i386-test/mysql-test/r/archive_gis.reject	Fri Aug 22 01:33:01 2008
@@ -326,8 +326,8 @@
 116	0
 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
 fid	AsText(Centroid(g))
-117	POINT(55.58852775304245 17.426536064113982)
-118	POINT(55.58852775304245 17.426536064113982)
+117	POINT(55.58852775304245 17.42653606411398)
+118	POINT(55.58852775304245 17.42653606411398)
 119	POINT(2 2)
 SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
 fid	Area(g)

mysqltest: Result content mismatch

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

How to repeat:
Build 6.0 with gcc on Solaris 10 x86_64 and run the archive_gis test case.

Suggested fix:
Only output the first X digits of the result in the test case.
[22 Aug 2008 11:16] Daniel Fischer
Other failing test cases with the same problem:

main.gis [ fail ]

--- /export/home/pb2/test/sourcebuilder-build-4940-1219357808.52/mysql-6.0.7-alpha-solaris10-i386-test/mysql-test/r/gis.result	Fri Aug 22 00:04:15 2008
+++ /export/home/pb2/test/sourcebuilder-build-4940-1219357808.52/mysql-6.0.7-alpha-solaris10-i386-test/mysql-test/r/gis.reject	Fri Aug 22 01:42:37 2008
@@ -318,8 +318,8 @@
 116	0
 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
 fid	AsText(Centroid(g))
-117	POINT(55.58852775304245 17.426536064113982)
-118	POINT(55.58852775304245 17.426536064113982)
+117	POINT(55.58852775304245 17.42653606411398)
+118	POINT(55.58852775304245 17.42653606411398)
 119	POINT(2 2)
 SELECT fid, Area(g) FROM gis_multi_polygon;
 fid	Area(g)
@@ -655,7 +655,7 @@
 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
 t1 where object_id=85984;
 object_id	geometrytype(geo)	ISSIMPLE(GEO)	ASTEXT(centroid(geo))
-85984	MULTIPOLYGON	0	POINT(-114.87787186923313 36.33101763469049)
+85984	MULTIPOLYGON	0	POINT(-114.87787186923329 36.331017634690426)
 drop table t1;
 create table t1 (fl geometry not null);
 insert into t1 values (1);

mysqltest: Result content mismatch

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

main.innodb_gis [ fail ]

--- /export/home/pb2/test/sourcebuilder-build-4940-1219357808.52/mysql-6.0.7-alpha-solaris10-i386-test/mysql-test/r/innodb_gis.result	Fri Aug 22 00:04:15 2008
+++ /export/home/pb2/test/sourcebuilder-build-4940-1219357808.52/mysql-6.0.7-alpha-solaris10-i386-test/mysql-test/r/innodb_gis.reject	Fri Aug 22 01:47:14 2008
@@ -326,8 +326,8 @@
 116	0
 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
 fid	AsText(Centroid(g))
-117	POINT(55.58852775304245 17.426536064113982)
-118	POINT(55.58852775304245 17.426536064113982)
+117	POINT(55.58852775304245 17.42653606411398)
+118	POINT(55.58852775304245 17.42653606411398)
 119	POINT(2 2)
 SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
 fid	Area(g)

mysqltest: Result content mismatch

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

ndb.ndb_gis [ fail ]

--- /export/home/pb2/test/sourcebuilder-build-4940-1219357808.52/mysql-6.0.7-alpha-solaris10-i386-test/mysql-test/suite/ndb/r/ndb_gis.result	Fri Aug 22 00:04:29 2008
+++ /export/home/pb2/test/sourcebuilder-build-4940-1219357808.52/mysql-6.0.7-alpha-solaris10-i386-test/mysql-test/suite/ndb/r/ndb_gis.reject	Fri Aug 22 03:08:10 2008
@@ -326,8 +326,8 @@
 116	0
 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
 fid	AsText(Centroid(g))
-117	POINT(55.58852775304245 17.426536064113982)
-118	POINT(55.58852775304245 17.426536064113982)
+117	POINT(55.58852775304245 17.42653606411398)
+118	POINT(55.58852775304245 17.42653606411398)
 119	POINT(2 2)
 SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
 fid	Area(g)
@@ -878,8 +878,8 @@
 116	0
 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
 fid	AsText(Centroid(g))
-117	POINT(55.58852775304245 17.426536064113982)
-118	POINT(55.58852775304245 17.426536064113982)
+117	POINT(55.58852775304245 17.42653606411398)
+118	POINT(55.58852775304245 17.42653606411398)
 119	POINT(2 2)
 SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
 fid	Area(g)

mysqltest: Result content mismatch

Stopping All Servers
Restoring snapshot of databases
Resuming Tests
[22 Aug 2008 17:49] Valeriy Kravchuk
Not repeatable on 32-bit Linux.
[17 Oct 2008 12:47] Sveta Smirnova
Thank you for the report.

Verified as described on support amd64 box.
[16 Dec 2008 15:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/61780

2746 Alexey Botchkov	2008-12-16
      Bug#38959      archive_gis fails due to rounding difference
              Multi_polygon::centroid() has an error in the implementation
      
      per-file messages:
        sql/spatial.cc
      Bug#38959      archive_gis fails due to rounding difference
              multi_polygon::centroid() implementation fixed
[12 Feb 2010 10:40] Alexander Nozdrin
The patch is Ok to push into next-mr-bugfixing.
[12 Feb 2010 10:42] Alexander Nozdrin
Bug#50356 has been marked as a duplicate of this one.
[18 Feb 2010 10:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/100729

2968 Alexey Botchkov	2010-02-17
      Bug#38959      archive_gis fails due to rounding difference
          Multi_polygon::centroid() has an error in the implementation
            
      per-file messages:
        sql/spatial.cc
      Bug#38959      archive_gis fails due to rounding difference
              multi_polygon::centroid() implementation fixed
[18 Feb 2010 14:18] Alexey Botchkov
pushed to mysql-next-mr-bugfixing
[25 Feb 2010 19:46] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100225194420-p60r4u90tszj8q2x) (version source revid:holyfoot@mysql.com-20100217102857-u1cclkfgipy5rso4) (merge vers: 6.0.14-alpha) (pib:16)
[25 Feb 2010 19:49] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100225194305-h49uyjrlfl3mwo60) (version source revid:holyfoot@mysql.com-20100217101917-riitwbv3vv8cvhes) (pib:16)
[6 Mar 2010 10:52] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:alik@sun.com-20100225195857-farb6yvy8x06bylj) (merge vers: 5.5.99-m3) (pib:16)
[27 Mar 2010 19:12] Joerg Bruehe
Setting the bug back to "verified":

In the release build of 5.5.3, it still happens on Solaris10 x86
(note that the original report was on x86_64).
The patch is contained in the sources, and it has helped for x86_64 (test passes), just not for x86.

The difference described in this bug occurs only in optimized runs, not in debug runs.

There is no such failure on any other platform in the 5.5.3 release build (x86 or other CPU), so the compiler seems to play an important part.
[12 May 2015 11:31] Norvald Ryeng
Posted by developer:
 
Can't reproduce in current 5.7.