Bug #16179 Ship useful functions with server
Submitted: 4 Jan 2006 10:12 Modified: 27 Jan 2011 13:36
Reporter: [ name withheld ] (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version:5.0.17 OS:Windows (WinXP sp2)
Assigned to: CPU Architecture:Any
Tags: qc

[4 Jan 2006 10:12] [ name withheld ]
Description:
Hi, I see that some useful functions like distance between two points are still missing, why don't you implement them as functions/stored procs and ship them with the database?
Like this:
DELIMITER $$

DROP FUNCTION IF EXISTS `test`.`distance` $$
CREATE FUNCTION `test`.`distance` (a POINT, b POINT) RETURNS REAL
COMMENT 'distance'
BEGIN
RETURN round(glength(linestringfromwkb(linestring(asbinary(a), asbinary(b)))));
END $$

DELIMITER ;

How to repeat:
Feature request
[28 Nov 2009 14:35] Valeriy Kravchuk
Thank you for the useful feature request.
[27 Jan 2011 13:36] Alexander Nozdrin
Already in the server (5.6, WL#1326).