Bug #81964 MySQL uses invalid WKT for empty geometrycollection
Submitted: 22 Jun 2016 5:10 Modified: 12 Aug 2016 16:47
Reporter: Sergey Fedoseev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.7.5, 5.7.13 OS:Any
Assigned to: CPU Architecture:Any

[22 Jun 2016 5:10] Sergey Fedoseev
Description:
MySQL uses 'GEOMETRYCOLLECTION()' as WKT representation of empty geometry collection, though as stated in OpenGISĀ® Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture WKT for geometry collections are defined by the following BNF:

<geometrycollection text> ::= <empty set> | <left paren> <geometry tagged text> {<comma> <geometry tagged text>}* <right paren>  

How to repeat:
mysql> SELECT ST_AsText(ST_Intersection(ST_GeomFromText('POINT (0 0)'), ST_GeomFromText('POINT (1 1)')));
+--------------------------------------------------------------------------------------------+
| ST_AsText(ST_Intersection(ST_GeomFromText('POINT (0 0)'), ST_GeomFromText('POINT (1 1)'))) |
+--------------------------------------------------------------------------------------------+
| GEOMETRYCOLLECTION()                                                                       |
+--------------------------------------------------------------------------------------------+
1 row in set (0,00 sec)

Suggested fix:
MySQL should use 'GEOMETRYCOLLECTION EMPTY' as WKT representation of empty geometry collections.
[22 Jun 2016 11:54] MySQL Verification Team
Hello Sergey Fedoseev,

Thank you for the report!

Thanks,
Umesh
[12 Aug 2016 16:47] Paul DuBois
Posted by developer:
 
Noted in 8.0.0 changelog.

Spatial functions for import and export of Well-Known Text (WKT)
values used nonstandard 'GEOMETRYCOLLECTION()' syntax rather than
OpenGIS standard 'GEOMETRYCOLLECTION EMPTY' syntax. Now both syntaxes
are understood for import and the standard syntax is used for export.