8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

MySQL 8.4 参考手册 / 7 MySQL 服务器管理 / 7.7 MySQL 服务器可加载函数
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

7.7 MySQL 服务器可加载函数7.7 MySQL Server Loadable Functions

MySQL 支持可加载函数,也就是说,这些函数不是内置的,但可以在运行时加载(无论是在启动期间还是之后)以扩展服务器功能,或者卸载以移除功能。有关可用可加载函数的表格,请参见 第 14.2 节,“可加载函数参考”。可加载函数与内置(本地)函数形成对比,内置函数是作为服务器的一部分实现的,并且始终可用;有关表格,请参见 第 14.1 节,“内置函数和操作符参考”。MySQL supports loadable functions, that is, functions that are not built in but can be loaded at runtime (either during startup or later) to extend server capabilities, or unloaded to remove capabilities. For a table describing the available loadable functions, see Section 14.2, “Loadable Function Reference”. Loadable functions contrast with built-in (native) functions, which are implemented as part of the server and are always available; for a table, see Section 14.1, “Built-In Function and Operator Reference”.

Note

可加载函数以前被称为用户自定义函数(UDF)。这个术语有些不准确,因为“用户自定义”也可以适用于其他类型的函数,例如存储函数(使用 SQL 编写的一种存储对象类型)以及通过修改服务器源代码添加的本地函数。Loadable functions previously were known as user-defined functions (UDFs). That terminology was something of a misnomer because “user-defined” also can apply to other types of functions, such as stored functions (a type of stored object written using SQL) and native functions added by modifying the server source code.

MySQL 发行版包括可加载函数,这些函数全部或部分实现了这些服务器功能:MySQL distributions include loadable functions that implement, in whole or in part, these server capabilities:

以下各节介绍了如何安装和卸载可加载函数,以及如何在运行时确定已安装的可加载函数并获取有关它们的信息。The following sections describe how to install and uninstall loadable functions, and how to determine at runtime which loadable functions are installed and obtain information about them.

在某些情况下,可加载函数是通过安装实现该函数的组件来加载的,而不是通过直接加载函数来实现的。有关特定可加载函数的详细信息,请参阅包含该函数的服务器功能的安装说明。In some cases, a loadable function is loaded by installing the component that implements the function, rather than by loading the function directly. For details about a particular loadable function, see the installation instructions for the server feature that includes it.

有关编写可加载函数的信息,请参见 向 MySQL 添加函数。For information about writing loadable functions, see Adding Functions to MySQL.