MySQL 5.7错误:无法从发送到GEOMETRY字段的数据中获取几何对象 [英] MySQL 5.7 error: Cannot get geometry object from data you send to the GEOMETRY field
问题描述
我有一栏使我对MySQL Server 5.7.11感到头疼.
I have a column that is giving me a headache on MySQL Server 5.7.11.
它的类型为POINT
,我可以毫无问题地将其更改为类型GEOMETRY
.
It was of type POINT
and I was able to change it to type GEOMETRY
with no issues.
当我现在尝试将其从GEOMETRY
更改为POINT
时,出现以下错误:
When I now try and change it from GEOMETRY
to POINT
I get the following error:
Error 1416: Cannot get geometry object from data you send to the GEOMETRY field SQL Statement: ALTER TABLE
表
CHANGE COLUMN
列名列名
POINT NOT NULL;
Error 1416: Cannot get geometry object from data you send to the GEOMETRY field SQL Statement: ALTER TABLE
table
CHANGE COLUMN
column_namecolumn_name
POINT NOT NULL;
我认为为什么我可以以一种方式而不是另一种方式更改它.
I doesn't make sense to me why I could change it one way and not the other.
我在使用POINT
数据类型时遇到了麻烦,尤其是当我尝试执行select语句时,有时会出现相同的错误.
I have been having trouble with the POINT
datatype, especially when I try and do select statements, it sometimes comes with the same error.
推荐答案
"GEOMETRY可以存储任何类型的几何值.其他单值类型(POINT,LINESTRING和POLYGON)将其值限制为特定的几何类型. "
"GEOMETRY can store geometry values of any type. The other single-value types (POINT, LINESTRING, and POLYGON) restrict their values to a particular geometry type."
因此您可以将POINT转换为GEOMETRY-但是因为GEOMETRY可以包含其他几何值,所以您不能采用其他方法.
So you can convert POINT to GEOMETRY - but because GEOMETRY can contain other geometry values you cannot go the other way.
https://dev.mysql.com/doc/refman/5.7/en/spatial-datatypes.html
这篇关于MySQL 5.7错误:无法从发送到GEOMETRY字段的数据中获取几何对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!