Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL)
-
None
-
10.2.11
Description
MariaDB [(none)]> SELECT st_astext(st_geomfromgeojson(' |
'> { |
'> "type": "MultiLineString", |
'> "coordinates": [ |
'> ] |
'> }')) as a; |
+------------------+
|
| a |
|
+------------------+
|
| MULTILINESTRING) |
|
+------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [(none)]>
|
MariaDB [(none)]> SELECT st_astext(st_geomfromgeojson('
|
'> { |
'> "type": "Polygon", |
'> "coordinates": [ |
'> ] |
'> }')) as a; |
+----------+ |
| a |
|
+----------+ |
| POLYGON) |
|
+----------+ |
1 row in set (0.00 sec) |
|
MariaDB [(none)]>
|
MariaDB [(none)]> SELECT st_astext(st_geomfromgeojson(' |
'> { |
'> "type": "MultiPolygon", |
'> "coordinates": [ |
'> ] |
'> }')) as a; |
+---------------+ |
| a |
|
+---------------+ |
| MULTIPOLYGON) |
|
+---------------+ |
1 row in set (0.00 sec) |
These objects are valid in json, but invalid in geojson , so must be handled accordingly.
According to the spec http://geojson.org/geojson-spec.html empty array is allowed, so this may be bug in st_astext() , because formatting of doesn't look correct
On the other hand Point type must be rejected when it is not complete:
| POINT(-9.255963134931783e61 -9.255963134931783e61) | POINT(0 -9.255963134931783e61) |
And again - behavior is inconsistent with st_geomfromtext(), (which cannot accept empty array) and MySQL 5.7, which throws an error to all these cases,
So let me know if this bug should be split into two (e.g. one for Point and one for st_astext() or if we just reject such inputs )