Bug #117134 ST_Buffer gives unexpected result with LinearRing
Submitted: 8 Jan 10:25 Modified: 8 Jan 10:46
Reporter: shijie li Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: GIS Severity:S1 (Critical)
Version:8.0.40 OS:Any
Assigned to: CPU Architecture:Any

[8 Jan 10:25] shijie li
Description:
When calculating the buffer of a LinearRing, MySQL gives an unexpected result, which is a completely unordered and invalid Polygon that does not even contain the original input.

How to repeat:
SET @g1 = ST_GeomFromText('LINESTRING(25 44, 31 44, 32 38, 29 37, 25 37, 25 38, 24 40, 24 44, 25 44)');
SET @g2 = ST_Buffer(ST_GeomFromText('LINESTRING(25 44, 31 44, 32 38, 29 37, 25 37, 25 38, 24 40, 24 44, 25 44)'), 5);

SELECT ST_Distance(@g1, ST_ExteriorRing(@g2)), ST_Contains(@g2, @g1), ST_IsValid(@g2);

-- expected:{5, t, t}
-- actual  :{0, f, f}
[8 Jan 10:46] MySQL Verification Team
Hello shijie li,

Thank you for the report and feedback.

regards,
Umesh