I\'m trying to make a function that recursively builds a path for a specific category
CREATE FUNCTION getPath(inId INT) RETURNS TEXT DETERMINISTIC BEGIN
MySQL does not allow recursive FUNCTIONs, even if you set max_sp_recursion_depth.
It does allow up to 255 recursion in a PROCEDURE if you set max_sp_recursion_depth.
So I recommend that you replace your function with a procedure, using an INOUT variable for the return_path.