DROP FUNCTION [IF EXISTS] function_name
This statement drops the user-defined function (UDF) named
FUNCTION is also used to drop stored functions; see
Section 13.1.29, “DROP PROCEDURE and DROP FUNCTION Statements”.)
FUNCTION is the complement of
FUNCTION. It requires the
DELETE privilege for the
mysql system schema because it removes the
row from the
mysql.func system table that
registers the function.
FUNCTION also removes the function from the
user_defined_functions table that
provides runtime information about installed UDFs. See
Section 188.8.131.52, “The user_defined_functions Table”.
During the normal startup sequence, the server loads UDFs
registered in the
mysql.func table. Because
FUNCTION removes the
for the dropped function, the server does not load the function
during subsequent restarts.
FUNCTION cannot be used to drop a UDF that is
installed automatically by components or plugins rather than by
FUNCTION. Such a UDF is also dropped automatically,
when the component or plugin that installed it is uninstalled.