Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql点数据类型&;glength返回null_Mysql_Sql_Geospatial_Spatial - Fatal编程技术网

Mysql点数据类型&;glength返回null

Mysql点数据类型&;glength返回null,mysql,sql,geospatial,spatial,Mysql,Sql,Geospatial,Spatial,下面的glength()语句始终返回null SET @mref_point1=point(12.937060,77.671280); SET @mref_point2=point(13.937060,73.271280); SELECT GLENGTH(LINESTRINGFROMWKB(linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2)))); 有人能给我指出正确的方向吗。我将此作为答案发布,以便代码更容易阅读: 尝试通过以下

下面的
glength()
语句始终返回null

SET @mref_point1=point(12.937060,77.671280);
SET @mref_point2=point(13.937060,73.271280);

SELECT GLENGTH(LINESTRINGFROMWKB(linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2))));

有人能给我指出正确的方向吗。

我将此作为答案发布,以便代码更容易阅读:

尝试通过以下步骤缩小问题范围:

select ASBINARY(@mref_point1)
如果未返回null,请继续执行以下操作:

select linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2))
select LINESTRINGFROMWKB(linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2)))
如果未返回null,请继续执行以下操作:

select linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2))
select LINESTRINGFROMWKB(linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2)))