When, I run (SRID = 4326)
Select st_distance_sphere( ST_GeomFromText( 'point(-51 -23)',4326), ST_GeomFromText('Point(-51.4264 -23.4158)',4326))/1000 as distance;
I get
'55.55951760685804'.
But, when, I run (SRID = 0)
Select st_distance_sphere( ST_GeomFromText( 'point(-51 -23)'), ST_GeomFromText( 'Point(-51.4264 -23.4158)'))/1000 as distance;
I get 63.5340251950123
, which looks like to be the right distance value.
But, I thought that function do not change its result by changing the SRID of the points. Even worse when its return wrong result when I set the SRID. Someone can help me understand what going on here ? =)
By the way, I am using Mysql 8.