本文介绍了函数ST_Distance_Sphere在MariaDB中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取我周围的所有位置,但是功能ST_Distance_Sphere不起作用.

我的查询:

select *, astext(location) as location from `locations`
where ST_Distance_Sphere(location, POINT(35.905069591297, 49.765869174153)) < 1000

错误:

SQLSTATE[42000]: Syntax error or access violation:
1305 FUNCTION app.ST_Distance_Sphere does not exist (SQL:
select *, astext(location) as location from `locations`
where ST_Distance_Sphere(location, POINT(35.905069591297, 49.765869174153)) < 1000)
解决方案

我在 DBA.SE


几乎令人难以置信的是, MariaDB缺少此ST_Distance_Sphere(MDEV-13467). /p>

在此处找到其支持列表.

>

不仅如此,它还缺少MySQL拥有的ST_GeoHash.

I want get all locations around my location but the function ST_Distance_Sphere does not work.

My query:

select *, astext(location) as location from `locations`
where ST_Distance_Sphere(location, POINT(35.905069591297, 49.765869174153)) < 1000

Error :

SQLSTATE[42000]: Syntax error or access violation:
1305 FUNCTION app.ST_Distance_Sphere does not exist (SQL:
select *, astext(location) as location from `locations`
where ST_Distance_Sphere(location, POINT(35.905069591297, 49.765869174153)) < 1000)
解决方案

A direct copy of my answer on DBA.SE,


Almost unbelievably, MariaDB lacks this ST_Distance_Sphere (MDEV-13467).

Find their support matrix here.

And it's not just that either, it also lacks ST_GeoHash that MySQL has.

这篇关于函数ST_Distance_Sphere在MariaDB中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 06:45