Bug #72863 Error message isn't sent to client when server reports one
Submitted: 4 Jun 2014 7:04 Modified: 4 Jun 2014 7:15
Reporter: Pavan Naik Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: gis, WL#7236

[4 Jun 2014 7:04] Pavan Naik
Description:
Error messages produced by the server are not sent to the client. Many functions returns NULL or some result on improper inputs without any informative warnings.

Please see the below examples :

SELECT ST_Area(GeomFromText('POLYGON((0 0,5 5))'));
ST_Area(GeomFromText('POLYGON((0 0,5 5))'))
NULL

For the above query, server returns NULL and an error message saying "Incorrect arguments, A polygon's ring must have at least 3 distinct points". But the error message is not sent to the client.

SELECT ST_Area(GeomFromText('POLYGON((4 4,4 6,6 6,6 4,4 4),(0 0,0 10,10 10,10 0,0 0))'));
ST_Area(GeomFromText('POLYGON((4 4,4 6,6 6,6 4,4 4),(0 0,0 10,10 10,10 0,0 0))'))
96

In the above query, the geometry is a invalid polygon having a inner ring larger than the outer ring. But the Area() function returns some value even though the geometry is invalid.

How to repeat:
SELECT ST_Area(GeomFromText('POLYGON((0 0,5 5))'));

SELECT ST_Area(GeomFromText('POLYGON((4 4,4 6,6 6,6 4,4 4),(0 0,0 10,10 10,10 0,0 0))'));
[4 Jun 2014 7:15] Pavan Naik
Already reported