MySQL Forums
Forum List  »  GIS

`ST_DISTANCE_SPHERE` different output in 5.7 and 8.0
Posted by: Matan Yadaev
Date: February 07, 2021 01:22PM

I write an open-source library that exposes an API to MySQL GIS functions from Laravel applications.
I run the library's tests on both MySQL 5.7 and 8.0, everything works fine except `ST_DISTANCE_SPHERE` - this function outputs different values for each MySQL version.


```sql
SELECT ST_DISTANCE_SPHERE(POINT(55.5, 23.1), POINT(55.51, 23.1));
# MySQL 5.7: 1022.792591459987
# MySQL 8.0: 1022.7925914593363
```

The difference begins in the tenth digit after the zero.

Any idea why it happens and how can I fix it?

Options: ReplyQuote


Subject
Views
Written By
Posted
`ST_DISTANCE_SPHERE` different output in 5.7 and 8.0
168
February 07, 2021 01:22PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.