A user-defined function (UDF) is a way to extend MySQL with a new
function that works like a native (built-in) MySQL function such as
ABS() or CONCAT().

function_name is the name that should be used in SQL statements to
invoke the function.  The RETURNS clause indicates the type of the
function's return value.  shared_library_name is the basename of the
shared object file that contains the code that implements the function. The
file must be located in a directory that is searched by your system's
dynamic linker.

To create a function, you must have the INSERT and privilege for the
mysql database.  To drop a function, you must have the DELETE
privilege for the mysql database.  This is because CREATE
FUNCTION adds a row to the mysql.func system table that records the
function's name, type, and shared library name, and DROP FUNCTION
deletes the function's row from that table.  If you do not have this table,
you should run the mysql_fix_privilege_tables script to create it.
See also : [Upgrading-grant-tables].
