Bug #76337 Geometry object construction functions accept illegal input
Submitted: 16 Mar 2015 14:23 Modified: 28 May 2015 17:33
Reporter: Norvald Ryeng Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.7.8 OS:Any
Assigned to: CPU Architecture:Any

[16 Mar 2015 14:23] Norvald Ryeng
Description:
The geometry object constructor functions accept invalid input parameters. E.g., MULTIPOLYGON() should only allow polygon parameters, POINT() should only allow numeric parameters, etc., but all kinds of combinations are currently legal. The result of most of these are NULL, which means that the problem is probably detected without raising exception conditions.

How to repeat:
SELECT HEX(POLYGON(POINT(0,0)));
SELECT HEX(POINT(POINT(0,0),0));
SELECT HEX(MULTIPOLYGON(LINESTRING(POINT(0,0),POINT(1,0),POINT(1,1),POINT(0,0))));
SELECT HEX(MULTIPOLYGON(POINT(0,0)));
SELECT HEX(MULTIPOINT(LINESTRING(POINT(0,0),POINT(1,1))));

Suggested fix:
Check input types and raise an exception condition if the type is invalid.
[28 May 2015 1:15] Wei Zhao
Posted by developer:
 
One reviewer is sufficient for this bug fix, so setting status to 'patch approved'.
[28 May 2015 17:33] Paul DuBois
Noted in 5.7.8, 5.8.0 changelogs.

Geometry object constructor functions such as Point() and
MultiPolygon() now are stricter about rejecting invalid arguments.