ALTER FUNCTIONfunc_name[characteristic...]characteristic: { COMMENT 'string' | LANGUAGE SQL | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } }
此语句可用于更改存储函数的特性。在一个 ALTER FUNCTION 语句中可以指定多个更改。然而,无法使用此语句更改存储函数的参数或主体;要进行此类更改,必须使用 DROP
FUNCTION 和 CREATE
FUNCTION 重新创建函数。This statement can be used to change the characteristics of a
stored function. More than one change may be specified in an
ALTER FUNCTION statement. However,
you cannot change the parameters or body of a stored function
using this statement; to make such changes, you must drop and
re-create the function using DROP
FUNCTION and CREATE
FUNCTION.
您必须拥有该函数的ALTER ROUTINE权限。(该权限会自动授予函数创建者。)如果启用了二进制日志记录,ALTER FUNCTION语句可能还需要SUPER权限,如第 27.7 节,“存储程序二进制日志记录”中所述。You must have the ALTER ROUTINE
privilege for the function. (That privilege is granted
automatically to the function creator.) If binary logging is
enabled, the ALTER FUNCTION
statement might also require the
SUPER privilege, as described in
Section 27.7, “Stored Program Binary Logging”.