文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 15 条 SQL 语句 / 15.1 数据定义语句 / 15.1.29 DROP PROCEDURE 和 DROP FUNCTION 语句
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

15.1.29 DROP PROCEDURE 和 DROP FUNCTION 语句这些15.1.29 DROP PROCEDURE and DROP FUNCTION Statements

DROP {PROCEDURE | FUNCTION} [IF EXISTS] sp_name

语句用于丢弃存储例程(存储过程或函数)。也就是说,指定的例程从服务器中移除。(DROP FUNCTION 也用于丢弃可加载函数;参见 第 15.7.4.2 节,“DROP FUNCTION Statement for Loadable Functions”。)These statements are used to drop a stored routine (a stored procedure or function). That is, the specified routine is removed from the server. (DROP FUNCTION is also used to drop loadable functions; see Section 15.7.4.2, “DROP FUNCTION Statement for Loadable Functions”.)

要丢弃存储例程,必须拥有 ALTER ROUTINE 权限。(如果启用 automatic_sp_privileges系统变量,该权限和 EXECUTE 会自动授予例程创建者,丢弃例程时从创建者中丢弃。参见 第 27.2.2 节,“存储例程与 MySQL 权限”。)To drop a stored routine, you must have the ALTER ROUTINE privilege for it. (If the automatic_sp_privileges system variable is enabled, that privilege and EXECUTE are granted automatically to the routine creator when the routine is created and dropped from the creator when the routine is dropped. See Section 27.2.2, “Stored Routines and MySQL Privileges”.)

此外,如果例程的定义器拥有 SYSTEM_USER 权限,则丢弃该权限的用户也必须拥有该权限。In addition, if the definer of the routine has the SYSTEM_USER privilege, the user dropping it must also have this privilege.

IF EXISTS 子句是 MySQL 的一个扩展。它防止在过程或函数不存在时发生错误。生成的警告可显示为 SHOW WARNINGS“。The IF EXISTS clause is a MySQL extension. It prevents an error from occurring if the procedure or function does not exist. A warning is produced that can be viewed with SHOW WARNINGS.

DROP FUNCTION 也用于丢弃可加载函数(参见 第 15.7.4.2 节,”DROP FUNCTION Statement for Loadable Functions“)。DROP FUNCTION is also used to drop loadable functions (see Section 15.7.4.2, “DROP FUNCTION Statement for Loadable Functions”).