ALTER PROCEDUREproc_name[characteristic...]characteristic: { COMMENT 'string' | LANGUAGE SQL | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } }
此语句可用于更改存储过程的特性。在一个 ALTER PROCEDURE 语句中可以指定多个更改。然而,不能使用此语句更改存储过程的参数或主体;要进行此类更改,必须使用 DROP
PROCEDURE 和 CREATE
PROCEDURE 重新创建该过程。This statement can be used to change the characteristics of a
stored procedure. More than one change may be specified in an
ALTER PROCEDURE statement. However,
you cannot change the parameters or body of a stored procedure
using this statement; to make such changes, you must drop and
re-create the procedure using DROP
PROCEDURE and CREATE
PROCEDURE.
您必须拥有该存储过程的 ALTER ROUTINE 权限。默认情况下,该权限会自动授予存储过程的创建者。可以通过禁用 automatic_sp_privileges 系统变量来更改此行为。请参阅 第 27.2.2 节,“存储例程和 MySQL 权限”。You must have the ALTER ROUTINE
privilege for the procedure. By default, that privilege is granted
automatically to the procedure creator. This behavior can be
changed by disabling the
automatic_sp_privileges system
variable. See Section 27.2.2, “Stored Routines and MySQL Privileges”.