1

I have the same MySQL DB on my Local and Server. I exported DB file on my local and imported it on Server.

My Local MySQL Version is MariaDB 10.4 and Server MySQL Version is MySQL 8.0

I'm running this query on both to get results.

SELECT * FROM district WHERE ST_Contains(POLYGON, ST_GeomFromText('POINT(-83.8754503501234 35.932752462484174)'));

On my local, it returns 8 results which are correct but on server, it's returning only 6 results and it's missing 2 rows.

I'm not sure what the issue is but I guess it's related to either MySQL Version or configuration?

Thank you!

danblack
  • 12,130
  • 2
  • 22
  • 41
LoveCoding
  • 1,121
  • 2
  • 12
  • 33
  • 2
    The accuracy of a point within a polygon isn't a matter of configuration. Either MySQL or MariaDB is incorrect depending on your POLYGON values. Recommend extracting the 8 results, putting them in a [db fiddle](https://dbfiddle.uk), running the test on Postgres as well (might have minor SQL changes), and reporting a bug against which ever implementation has the minority answer. – danblack Sep 15 '22 at 22:32
  • I couldn't set db fiddle properly. It was a little tricky. Anyway I uninstalled MySQL 8.0 on my server and installed MariaDB 10.4 and it's working well. I'm not sure why it's not working on MySQL 8.0 but works well on MariaDB 10.4. I only exported one record of district table and that should be enough to test if point is in polygon or not with the above query I put on main description. I uploaded SQL Dump here. we.tl/t-xH5gKHZzBQ And this image is showing how polygon looks like and geo tag is rendered. prnt.sc/5N3K6sf9Ej7Q Thank you! – LoveCoding Sep 16 '22 at 07:40

0 Answers0