Bug #92130 ST_Buffer creates a multipolygon with multiple polygons without any inner rings
Submitted: 22 Aug 2018 15:52 Modified: 20 Oct 2018 22:21
Reporter: Mike McCutcheon Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: GIS Severity:S2 (Serious)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[22 Aug 2018 15:52] Mike McCutcheon
Description:
When ST_Buffer is used on a multilinestring it creates a multipolygon with a series of polygons but no inner rings. Any inner ring is defined as another polygon.

This means that functions like ST_Intersects do not work properly on a multipolygon created by ST_Buffer. For example, a point inside the inner ring of a doughnut in a multipolygon should not intersect with the multipolygon. However, ST-Buffer defines the inner ring as a polygon, so ST_Intersects thinks that the point intersects with the multipolygon

How to repeat:
I'm really sorry but I don't have time to create code to repeat this now. The developer will recognize the scenario and have code to test for it. I do have my own PHP / MySQL test scripts which illustrate this bug but you don't want us to include links so please email me at mike@around-the-world.co.uk if you need proof.

Suggested fix:
Now I know there is a bug, I use PHP to parse the multipolygon created by st_buffer, test whether each polygon is contained by a previous polygon and - if so - define it as an inner ring of that previous polygon - not as a new polygon. I am an amateur programmer, so I imagine it will be easy for the developer to correct his/her code.
[20 Sep 2018 22:21] MySQL Verification Team
Thank you for the bug report. We need a test case (create table, insert data, queries, real result, expected result, MySQL server version 5.7.XX). Thanks in advance.
[21 Oct 2018 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".