| Bug #113207 | Potential bug in ST_Contains | ||
|---|---|---|---|
| Submitted: | 24 Nov 2023 6:40 | Modified: | 19 Feb 2024 13:42 |
| Reporter: | Wendy Deng | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: GIS | Severity: | S3 (Non-critical) |
| Version: | 8.2.0, 8.0.35, 8.1.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[24 Nov 2023 8:12]
MySQL Verification Team
Hello Wendy, Thank you for the report and test case. Verified as described. regards, Umesh
[19 Feb 2024 13:42]
Vissarion Fysikopoulos
Posted by developer: Fixed after upgrading to boost 1.84 https://mybug.mysql.oraclecorp.com/orabugs/site/bug.php?id=35259498

Description: Geometry g1 and g2 present the same polygon, but MySQL GIS gives different answers when querying ST_Contains(@g3, @g1) and ST_Contains(@g3, @g2), which seems a bug. How to repeat: Consider the following statements: ```sql SET @g1 = ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON((300 190,935 665,720 885,300 190)))'); SET @g2 = ST_GeomFromText('POLYGON((300 190,935 665,720 885,300 190))'); SET @g3 = ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON((655 435,55 75,90 5,655 435)),POLYGON((300 190,935 665,720 885,300 190)))'); SELECT ST_Contains(@g3, @g1); -- result{1} SELECT ST_Contains(@g3, @g2); -- expected{1}; actual{0} ``` It is noticed that g1 and g2 present the same polygon, but MySQL GIS gives different answers when querying ST_Contains(@g3, @g1) and ST_Contains(@g3, @g2), which seems a bug. Geometry @g3 completely contains g2, but MySQL GIS returns the unexpected result `0`. Version: 8.2.0 the latest version in Github: 87307d4ddd88405117e3f1e51323836d57ab1f57