Mysql point data type & glength returns null
The following glength()
statement returns null always.
SET @mref_point1=point(12.937060,77.671280);
SET @mref_point2=point(13.937060,73.271280);
SELECT G开发者_运维知识库LENGTH(LINESTRINGFROMWKB(linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2))));
Can someone point me in right direction.
I post this as an answer so the code can be read more easily:
Try narrowing down the problem by these steps:
select ASBINARY(@mref_point1)
If that does not return null go ahead and do:
select linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2))
If that does not return null go ahead and do:
select LINESTRINGFROMWKB(linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2)))
精彩评论