anchor.diff:    DETERMINISTIC 
     COMMENT 'Calculate the distance between two points' 
     BEGIN 
  -    RETURN glength(linestringFromwkb(linestring(geomfromtext(astext(a)),geomfromtext(astext(b)))));
  +    RETURN 6371 * 2 * ASIN(SQRT(POWER(SIN(RADIANS(ABS(X(a)) - ABS(X(b)))), 2) + COS(RADIANS(ABS(X(a)))) * COS(RADIANS(ABS(X(b)))) * POWER(SIN(RADIANS(Y(a) - Y(b))), 2)));
     END$$
   
   -- Switch the delimiter back to ;
  
positive.code:   DETERMINISTIC 
    COMMENT 'Calculate the distance between two points' 
    BEGIN 
      RETURN glength(linestringFromwkb(linestring(geomfromtext(astext(a)),geomfromtext(astext(b)))));
    END$$
  
  -- Switch the delimiter back to ;
  
negative.code: 
  USE test_hutmap;
  
  DROP FUNCTION IF EXISTS `distance`;
  
  -- Switch delimiter so the ; will work in the function body
  DELIMITER $$
  