Problem/Motivation

Null SQL values can be generated from the Haversine implementation, instead of the expected 0 (zero) value, e.g., when the origin/destination have the same exact Lat/Lng values.

Proposed resolution

We can work around the issue by using IFNULL( ..., 0) and get the expected 0 value.

CommentFileSizeAuthor
#2 null_sql_result_with-2761811-2.patch1.28 KBjtwalters
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jtwalters created an issue. See original summary.

jtwalters’s picture

Here's a patch that provides the IFNULL( ..., 0) change to ensure a zero value is returned when the origin/destination are exactly the same.

jtwalters’s picture

Assigned: jtwalters » Unassigned
Status: Active » Needs review
jtwalters’s picture

Status: Needs review » Needs work

Actually, IFNULL isn't ideal, since it'll result in a value of "0" where geofield data does not exist on content. A better solution seems to be LEAST(1, ...) which I can attach a patch for.