我的问题是 MySQL 将我的函数调用检测为类似本地模式存储过程调用。我不知道如何明确指定这是一个 MySQL 系统函数(或者我应该如何更改 SQL)。
我的 SQL 代码是:
set @p = GeomFromText('POINT(32.8303610 34.9743380)');
select OBJECTID FROM demog_yishuv_stat08_publish
where ST_Contains(demog_yishuv_stat08_publish.Shape, @p);
我得到的回复是:
Error Code: 1305. FUNCTION mySchema.ST_Contains does not exist
ST_Contains 是一个 MySQL 函数,未在 mySchema 中定义。 This is the doc对于 ST_CONTAINS。
任何帮助:非常感谢!
最佳答案
确保您使用的是 MySQL 5.6.1 或更高版本。 ST_Contains 是在 5.6.1 中添加的。从您引用的文档中:
As of MySQL 5.6.1, corresponding versions are available that use precise object shapes. These versions are named with an ST_ prefix. For example, Contains() uses object bounding rectangles, whereas ST_Contains() uses object shapes.
以前版本的 MySQL 提供了 Contains 函数,该函数使用两个几何图形的 MBR(而不是它们的确切形状)进行测试。如果您无法升级 MySQL,这可能对您有用。
关于MySQL 将系统函数调用解释为架构函数调用(错误代码 1305 : Function does not exist),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17470960/