Добрый день! Раньше запрос работал нормально, но со сменой хостинга (vps) видимо стало что-то с версиями или настройкой php\mySQL.
Вываливает вот так:
SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION admin_primary.dist does not exist
The SQL being executed was: SELECT COUNT(*) FROM `offer` `of` WHERE (((`of`.`publish`=1) AND (`online`=1)) AND (dist('53.25604370410152'g_longitude, '53.25604370410152'g_latitude, :'56.84781419393038', :'53.25604370410152') < :'7827.136630738911')) AND (kind_id<>0)
Error Info: Array
(
[0] => 42000
[1] => 1305
[2] => FUNCTION admin_primary.dist does not exist
)
↵
Caused by: PDOException
SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION admin_primary.dist does not exist
in /var/www/admin/data/www/site.ru/app/vendor/yiisoft/yii2/db/Command.php at line 437
Вот функция проверки:
public function handleException(\Exception $e, $rawSql)
{
if ($e instanceof Exception) {
throw $e;
} else {
$exceptionClass = '\yii\db\Exception';
foreach ($this->exceptionMap as $error => $class) {
if (strpos($e->getMessage(), $error) !== false) {
$exceptionClass = $class;
}
}
$message = $e->getMessage() . "\nThe SQL being executed was: $rawSql";
$errorInfo = $e instanceof \PDOException ? $e->errorInfo : null;
throw new $exceptionClass($message, $errorInfo, (int) $e->getCode(), $e);
}
}
Премного благодарен за внимание.