I have a column that is giving me a headache on MySQL Server 5.7.11.
It was of type POINT and I was able to change it to type GEOMETRY with no issues.
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 TABLEtable
CHANGE COLUMNcolumn_namecolumn_namePOINT NOT NULL;
I doesn't make sense to me why I could change it one way and not the other.
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 can store geometry values of any type. The other single-value types (POINT, LINESTRING, and POLYGON) restrict their values to a particular geometry type."
So you can convert POINT to GEOMETRY - but because GEOMETRY can contain other geometry values you cannot go the other way.