I have a simple MySQL stored function. I want it converted into a UDF. The UDF will be installed under 64-bit Linux - CentOS - on an AMD Opteron machine.
I want:
1. UDF to achieve the same functionality as stored function.
2. A test harness.
3. The logic will evolve a little bit based on performance of the UDF. Will provide details later.
4. Complete directions for building and installing the UDF
Here is a simplified version of the function:
DROP FUNCTION IF EXISTS spc;
CREATE FUNCTION spc (c double, p double)
RETURNS double DETERMINISTIC
RETURN ifnull((2 * ((c-p)/(c+p))),0);