Bug #54247 POINT() Conflicting behavior and Documentation
Submitted: 4 Jun 2010 21:38 Modified: 18 Jun 2010 14:34
Reporter: Donna Harmon Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1.47 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[4 Jun 2010 21:38] Donna Harmon
Description:
SELECT POINT with *no* comma returns an error and *with* comma returns values.

Point functions SELECT X and SELECT Y function properly when Point is set with *no* comma and return NULL when Point is set *with* comma.

Documentation here shows POINT as Point(x,y) (Note the comma):
http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#function_point

Documentation here shows Point() being used with Point() functions X() and Y() working when *NO* comma is used in setting the point:
http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#point-property-fun...

Should there be a comma or not?  If there should, Point() functions should also return errors if the point is set *without* a comma.

How to repeat:
#SELECT POINT WITH NO COMMA RETURNS ERROR AND WITH COMMA RETURNS VALUES
SELECT POINT(155 1037);
SELECT POINT(155, 1037);

# BELOW FUNCTIONS WORK CORRECTLY *WITHOUT* COMMA BUT NOT *WITH* COMMA
SET @pt = 'Point(56.7 53.34)';
SELECT X(GeomFromText(@pt));

SET @pt = 'Point(56.7 53.34)';
SELECT Y(GeomFromText(@pt));

SET @pt = 'Point(56.7,53.34)';
SELECT X(GeomFromText(@pt));

SET @pt = 'Point(56.7,53.34)';
SELECT Y(GeomFromText(@pt));

Suggested fix:
Make functionality and documentation consistent.
[18 Jun 2010 14:34] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Updated http://dev.mysql.com/doc/refman/5.1/en/gis-wkt-format.html with info about the distinction between WKT and POINT() SQL function syntax.

Updated examples at http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#point-property-fun... to use POINT() SQL function directly to avoid confusion.