这是本节的多页打印视图。
MySQL
- 1: 安装与首次连接
- 2: 服务器配置与认证
- 2.1: 口令认证与 TLS
- 2.2: pg_mysql 对象索引
- 2.2.1: Schema
- 2.2.2: 类型与域
- 2.2.3: 排序规则
- 2.2.4: 类型转换
- 2.2.5: 函数
- 2.2.5.1: 字符串与二进制函数
- 2.2.5.2: 数值函数
- 2.2.5.3: 日期时间函数
- 2.2.5.4: 条件函数
- 2.2.5.5: 会话函数
- 2.2.5.6: 类型转换辅助函数
- 2.2.5.7: 比较运算符实现
- 2.2.5.8: 算术运算符实现
- 2.2.5.9: 位运算与逻辑运算符实现
- 2.2.5.10: 模式匹配与 JSON 运算符实现
- 2.2.5.11: 字符串与数值辅助函数
- 2.2.5.12: 日期时间辅助函数
- 2.2.5.13: 二进制与字符串存储辅助函数
- 2.2.5.14: 聚合支持函数
- 2.2.5.15: 索引支持函数
- 2.2.5.16: 会话状态与变量辅助函数
- 2.2.5.17: DDL 与写入辅助函数
- 2.2.5.18: SHOW 与元数据辅助函数
- 2.2.6: 聚合
- 2.2.7: 运算符
- 2.2.8: 元数据视图
- 2.2.9: 元数据表
- 2.2.10: 索引访问方法、运算符类与族
- 2.2.11: 运算符族成员
- 2.2.12: 表索引
- 2.2.13: 主键与域检查约束
- 2.2.14: 元数据 schema 的非空约束
- 2.2.15: performance_schema.events_* 非空约束
- 2.2.16: 其他 performance_schema 表的非空约束
- 3: SQL 与类型兼容
- 4: 客户端与驱动
- 5: 迁移与恢复
- 6: 限制与排障
- 7: 协议、方言与来源
MySQL 客户端可以在 TCP 3306 端口建表,PostgreSQL 客户端可以在 5432 端口读到这张表。Mimus 19.0.1 使用 PostgreSQL 19.0、源自 OpenHalo 的内核钩子和独立的 pg_mysql 1.0 扩展。两种连接共享表和角色,均能读到其他会话已提交的数据,各自使用自己的线缆协议和 SQL 方言。
我连的是哪个数据库?
所有 MySQL 连接进入 mysql.database 指定的 PostgreSQL 数据库,默认是 postgres。其中每个 MySQL「数据库」对应一个 PostgreSQL schema。按起步示例,mysql … app 选中 app schema,psql -d postgres 可以用 app.notes 访问其中的表。MySQL 的 USE 切换当前连接选用的 schema。
第一次连接
安装与首次连接从配套源码开始,走通普通用户登录、写入一行和 PostgreSQL 读回。需要让其他主机访问或调整已有服务时,参阅服务器配置与认证。
迁移应用之前
先查用来标识行的键,再查读取这些行的事务。无符号 64 位键可能超出支持范围,可写的 REPEATABLE READ 事务中两次普通读取也可能读到不同的提交。核对源库取值,用应用实际使用的驱动重放一笔完整事务。SQL 与类型 · 已测驱动 · 迁移与恢复 · 限制与排障
工作原理
协议与语法来自 OpenHalo。Mimus 将 300/301 内核补丁与独立构建的扩展配套使用。MySQL 内核补丁 · 源码版本与署名
业务还需要 SQL Server 协议时,请使用另一实例。更多方言语法可查阅 PG.CENTER 的 OpenHalo 手册。实例配置 · OpenHalo 参考手册
1 - 安装与首次连接
本例使用全新的 Linux 实例、本机 PostgreSQL 管理员和 MariaDB 提供的 mysql 客户端。证书步骤需要 OpenSSL 命令行工具。两个端口都须空闲。完成后,应用用户拥有自己的 schema,可以自行建表读写。下面的 TLS 证书供本机回环连接使用。
安装配套内核和扩展
本例从两个本地仓库构建 19.0.1-r4 内核和 MySQL 扩展,pgsty/mimus 位于 mimus/,pgsty/pg_mysql 位于 pg_mysql/。候选分支尚待上传。请管理员先准备一个构建用户可写的全新安装前缀 /usr/mimus-19,再以构建用户在两个仓库的共同上级目录打开 Bash。Debian 13 上的构建依赖为 build-essential、git、tar、bison、flex、perl(含 FindBin)、pkg-config、libicu-dev、libssl-dev、libreadline-dev 和 zlib1g-dev。
预期显示 PostgreSQL 19.0 和已安装的 control 文件路径。若已安装上述提交的内核,将 PREFIX 设为该安装前缀,跳过内核的导出、配置、编译和安装步骤。扩展通过该前缀的 bin/pg_config 使用已安装的服务端头文件和 PGXS。运行数据库的系统用户须能读取和执行其中的文件。内核与扩展源码身份
初始化实例、预加载并重启
以操作系统用户 postgres 打开 shell,选择尚未使用的数据目录。本机原生套接字使用 peer 认证,回环 TCP 连接使用 SCRAM。先启动 PostgreSQL,再启用第二个监听端口。若在已有服务上操作,须保留其余预加载项,并使用该服务原有的重启命令。
预期返回 pg_mysql。预加载在实例重启时对整个集群生效,扩展的 SQL 对象则逐个 PostgreSQL 数据库安装。
用 psql 准备目标库和角色
在同一 shell 运行 psql -X -v ON_ERROR_STOP=1 -d postgres,以数据库超级用户执行以下命令。在提示处为新角色设置口令。新库默认向 PUBLIC 授予 CONNECT;若已撤销该权限,须向 app_user 授予 CONNECT ON DATABASE postgres。
扩展版本应为 1.0。统一 RC2 等早期开发构建也报告 1.0。从这些构建迁移应用时,在新集群安装扩展,再恢复业务 schema 和数据。恢复视图前,核对其中是否直接调用了扩展的私有辅助函数。本例所需的建表权限来自 app_user 对 app schema 的所有权。
用 mysql 写入,用 psql 读回
在同一系统 shell 中,通过 TCP 以普通数据库角色登录,输入刚设置的口令。如果客户端使用其他系统账号,复制一份可读的公有证书给该账号,并调整 CA 路径。
在 mysql 提示符内对 app schema 执行以下语句。
默认配置下,第一条查询返回 app、5.7.32-log 和 mimus。TLS 检查返回 1,最后一条查询返回一行 1 | hello。输入 exit,再以数据库管理员身份走原生端口复核。
从其他主机连接
将服务开放给应用之前,先配置监听网卡、HBA 规则、受信任 CA 与服务端证书身份。Oracle MySQL 和 MariaDB 客户端的 TLS 参数名称有差异。认证与 TLS
2 - 服务器配置与认证
SQL 对象索引
按安装后的签名查找函数重载、运算符、类型和 MySQL 元数据表或视图。pg_mysql 1.0 对象索引
核对实例的实际参数
管理员用原生 psql 查询。以下是 pg_mysql 1.0 注册的全部 14 个 PostgreSQL 参数。 boot_val 是编译默认值,setting 是当前后端的有效值。MySQL 的 @@ 变量另有命名,例如 SELECT @@max_allowed_packet 读取包长,而 PostgreSQL 配置项带有 mysql. 前缀。
需要重启的集群参数
| 参数 | 默认值与取值 | 作用 |
|---|---|---|
mysql.listener_on | 默认 on,布尔值 | 模块预加载后启用 MySQL TCP 监听。设为 off 后,下次启动时关闭该协议入口。 |
mysql.port | 默认 3306,整数 0–65535 | 0 关闭监听。原生 PostgreSQL 默认使用 5432。 |
mysql.listen_addresses | 默认未设置。主机名或 IP 列表,以逗号分隔,或取 * | 未设置或空串时继承 PostgreSQL 的 listen_addresses。继承到空列表时关闭 TCP。可为应用指定监听网卡。 |
mysql.auth_cache_size | 默认 1024,整数 0–1000000 项 | 快速认证共享缓存可容纳的用户数。设为 0 时,每次口令登录都走完整认证。 |
mysql.rsa_private_key_file | 默认 mysql_rsa_private_key.pem,文件路径 | 无 TLS 时完整认证使用的 RSA 私钥。相对路径以数据目录为起点,OpenSSL 构建在缺少该文件时生成密钥。空路径关闭 RSA 密钥加载。 |
mysql.auto_create_extension | 默认 on,布尔值 | 首个通过认证的 MySQL 超级用户连接可在收到登录成功响应前自动安装缺失的扩展。普通用户连接需要管理员提前安装。备库和二进制升级期间禁止自动安装。 |
重载生效的集群参数
修改实例实际使用的配置,并在 PostgreSQL 管理会话执行 SELECT pg_reload_conf();。重新连接以验证握手参数和目标库。
| 参数 | 默认值与取值 | 客户端何时能看到变化 |
|---|---|---|
mysql.database | 默认 postgres,PostgreSQL 数据库名 | 新连接进入指定库。先建库并在其中安装扩展;既有连接仍留在原库。 |
mysql.compat_version | 默认 5.7.32-log,字符串 | 可重载,格式为 主.次.修订,可带 -后缀。握手、VERSION() 和 @@version 返回完整字符串。数字部分决定握手排序规则和哪些版本条件注释会执行。重载时遇到无效值会保留当前有效版本。 |
mysql.default_authentication_plugin | caching_sha2_password(默认)或 mysql_clear_password | 下次登录握手时通告,服务端核验该角色的 PostgreSQL 凭证。 |
mysql.max_allowed_packet | 默认 67108864,整数 1024–1073741823 字节 | 限制传入的 MySQL 消息和预处理语句累计的 long data。用 SELECT @@max_allowed_packet 查询有效值。 |
mysql.deadlock_timeout | 默认 50ms,0–2147483647 毫秒 | 设置 MySQL 会话的动态默认值。正值同时将 log_lock_waits 默认设为 off;零继承 PostgreSQL 默认行为。显式实例、角色、库或会话设置优先。 |
重载 mysql.compat_version 后,如果版本条件注释让 ? 占位符的个数或位置发生变化,再次执行该预处理语句会收到错误 1615(HY000)。此时应重新准备语句,并按新版本绑定参数。参数位置相同的语句可以在原连接上继续执行。
会话参数
| 参数 | 默认值与取值 | 作用范围 |
|---|---|---|
mysql.parser | mysql(默认)、postgres;别名 postgresql | 选择 MySQL 连接后续语句所用语法,仍返回 MySQL 数据包。原生连接使用 PostgreSQL 解析器。 |
mysql.statement_rollback | 默认 on,布尔值 | MySQL 事务中普通语句出错时回滚到隐式保存点。关闭后,语句错误可能导致整个事务失败。死锁与序列化失败需要重试整笔事务。 |
mysql.default_collation | 字符串,默认 case_insensitive,还可用 case_sensitive、ignore_accents、MySQL 排序规则名;default 或空串取数据库默认值 | 后续 MySQL DDL 创建字符列时,列和表都未指定排序规则才使用此值。MySQL 名称按方言规则映射。已有列沿用原定义。 |
应用可在自己的连接中修改会话参数。例如,在 mysql 中切换解析器,经同一连接执行 PostgreSQL SQL,然后切回。
允许客户端接入
监听启用后,连接认证取决于目标 PostgreSQL 库、角色、TLS 和匹配的 HBA 规则。配置口令、HBA 与 TLS
到哪里找对应的 schema
用原生 psql 进入 mysql.database 指定的数据库。业务 schema 与扩展 schema 位于同一个库中。连接其他原生库时,看到的是该库自己的目录和已安装扩展。
2.1 - 口令认证与 TLS
口令认证
使用具备 LOGIN 且对目标 PostgreSQL 数据库有 CONNECT 权限的角色登录。pg_hba.conf 按目标库、角色、传输方式与客户端地址匹配,第一条匹配规则生效;选择 MySQL schema 及检查其权限发生在后。该监听器处理 reject、trust、password、md5、scram-sha-256 与 cert;其他 HBA 认证方式会返回不支持错误。PostgreSQL HBA 匹配规则
完整认证与缓存认证
MariaDB CLI 11.8.9 通过 TLS 连接时,命中 trust 规则的无口令登录可以成功。在同一条规则下提供口令会收到错误 1047。需要用口令登录时,使用匹配的 scram-sha-256 HBA 规则。
默认插件在缓存未命中时走完整认证:TLS 内传递口令,或在非 TLS 连接上通过 RSA-OAEP 交换口令。服务端使用角色的 PostgreSQL 验证器核对口令。scram-sha-256 HBA 规则要求角色持有 SCRAM 验证器。之后的连接可走快速质询应答;角色改密后旧缓存失效。RSA 仅保护口令交换,保护查询和结果集需要 TLS。旧客户端若要求 mysql_clear_password,应在 HBA 中强制 TLS,并在客户端启用该插件。
要求并验证 TLS
在支持 OpenSSL 的内核上设置 ssl=on 并提供服务端证书和私钥(ssl_cert_file、ssl_key_file)。证书须包含客户端使用的主机名或 IP。将下面的规则放在较宽泛的 host 规则前,并将 CIDR 替换成应用实际网段。这两条规则对使用两种 TCP 协议进入该 PostgreSQL 库的指定角色均生效。编辑后重载 HBA。
Oracle MySQL 客户端使用 --ssl-mode=VERIFY_IDENTITY --ssl-ca=ca.pem,MariaDB 客户端使用 --ssl-verify-server-cert --ssl-ca=ca.pem。连接证书对应的主机,在 MySQL 客户端中查询本后端的 TLS 状态。
2.2 - pg_mysql 对象索引
本索引只统计 Mimus 19.0.1 上一次全新安装 pg_mysql 1.0 得到的对象,源码对应 pg_mysql 提交 0d51adc。从这次安装快照到 r4 的变更,见源码对比(截至 1e631f9)。
可按名称查函数、按符号和操作数类型查运算符,也可从 information_schema 视图查到 PostgreSQL 端的对象名。每个签名均有独立页内锚点。
SQL 对象
| 类别 | 条目数 | 查询内容 |
|---|---|---|
| Schema | 4 | 从 PostgreSQL 与 MySQL 两端查找扩展的命名空间。 |
| 类型与域 | 97 | 3 个二进制基础类型、23 个域、71 个枚举。 |
| 排序规则 | 5 | 查找字符比较规则或核对列的排序依赖。 |
| 类型转换 | 88 | 80 个赋值转换,8 个隐式转换。 |
| 函数 | 1859 | 按名称找到函数,再按参数类型选择重载。 |
| 聚合 | 7 | 按输入类型查找聚合,核对每组结果的返回类型。 |
| 运算符 | 665 | 先匹配符号,再核对左右操作数类型。左侧为 NONE 表示一元前缀运算符。 |
| 元数据视图 | 20 | 在 MySQL 方言中使用 MySQL 名称,在 psql 中使用 PostgreSQL 名称。用途栏注明 SHOW 和待处理外键所用的视图。 |
| 元数据表 | 180 | 这些实体表提供兼容元数据。预置行数取自全新安装,Performance Schema 的表初始为空。 |
| 索引访问方法、运算符类与族 | 51 | 1 个访问方法、27 个运算符类、23 个运算符族。 |
索引与约束依赖
| 类别 | 条目数 | 查询内容 |
|---|---|---|
| 运算符族成员 | 168 | 127 项策略运算符、41 项支持函数注册。 |
| 表索引 | 119 | 61 个显式创建的索引,58 个主键配套索引。 |
| 主键与域检查约束 | 71 | 58 个主键、13 个域检查约束。 |
| 元数据 schema 的非空约束 | 341 | 按所属表的首字母查找 Performance Schema 以外各元数据表的列非空约束。 |
| performance_schema.events_* 非空约束 | 481 | 查找 Performance Schema 事件表的约束名和列定义。 |
| 其他 performance_schema 表的非空约束 | 589 | 查找 Performance Schema 其余表的约束名和列定义。 |
版本与计数口径
源码链接指向这次安装使用的文件和行号。生成定义指向创建该对象的 SQL 语句,C 指向 SQL 入口调用的 C 实现。
这次安装的 4,745 个索引条目包括 2,976 个直接扩展成员和 1,769 个依赖对象(族成员、表索引和约束)。PostgreSQL 还将 497 个自动派生类型登记为扩展成员。180 张表和 20 个视图各有一个同名行类型,200 个行类型和 97 个声明类型又各有一个数组类型。行类型按关系名查,数组按元素类型查。这 497 个派生类型随所属定义说明,不另计入条目数。每个重载计一项,类型的前置声明和完整定义合计一项。
种子数据随目标表列出。PUBLIC 获得扩展 schema 的 USAGE 以及各表和视图的 SELECT,并对 mysql.dual 具有 REFERENCES。限制执行权限的函数在各自条目中说明。 表与视图授权
2.2.1 - Schema
从 PostgreSQL 与 MySQL 两端查找扩展的命名空间。
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mys_informa_schema | 承载 MySQL 的 information_schema 元数据。 | SQL |
mys_sys | 承载 MySQL 的 sys 库。 | SQL |
mysql | 存放方言函数、运算符、类型和兼容关系。 | SQL |
performance_schema | 提供 Performance Schema 查询所需的表结构。 | SQL |
2.2.2 - 类型与域
查询列声明、二进制字面量和元数据表使用的类型。
二进制基础类型
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.binary_n | 存储带长度声明的定长 BINARY。 | 生成定义 |
mysql.hexlit | 十六进制或位字面量,可按字节串或数值解释。 | SQL |
mysql.varbinary_n | 存储带长度声明的变长 VARBINARY。 | 生成定义 |
域
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."bigint signed" | 基于 bigint 的域 | SQL |
mysql."bigint unsigned" | 基于 bigint 的域 · CHECK ((0 <= VALUE)) | SQL |
mysql."binary" | 基于 bytea 的域 | SQL |
mysql."int signed" | 基于 integer 的域 | SQL |
mysql."int unsigned" | 基于 bigint 的域 · CHECK (((0 <= VALUE) AND (VALUE <= ‘4294967295’::bigint))) | SQL |
mysql."mediumint signed" | 基于 integer 的域 · CHECK (((’-8388608’::integer <= VALUE) AND (VALUE <= 8388607))) | SQL |
mysql."mediumint unsigned" | 基于 integer 的域 · CHECK (((0 <= VALUE) AND (VALUE <= 16777215))) | SQL |
mysql."real" | 基于 double precision 的域 | SQL |
mysql."smallint signed" | 基于 smallint 的域 | SQL |
mysql."smallint unsigned" | 基于 integer 的域 · CHECK (((0 <= VALUE) AND (VALUE <= 65535))) | SQL |
mysql."smallint" | 基于 smallint 的域 | SQL |
mysql."tinyint signed" | 基于 smallint 的域 · CHECK (((’-128’::integer <= VALUE) AND (VALUE <= 127))) | SQL |
mysql."tinyint unsigned" | 基于 smallint 的域 · CHECK (((0 <= VALUE) AND (VALUE <= 255))) | SQL |
mysql."tinyint1 signed" | 基于 smallint 的域 · CHECK (((’-128’::integer <= VALUE) AND (VALUE <= 127))) | SQL |
mysql."tinyint1 unsigned" | 基于 smallint 的域 · CHECK (((0 <= VALUE) AND (VALUE <= 255))) | SQL |
mysql.blob | 基于 bytea 的域 | SQL |
mysql.datetime | 基于 timestamp without time zone 的域 | SQL |
mysql.double | 基于 double precision 的域 | SQL |
mysql.mediumint | 基于 integer 的域 · CHECK (((’-8388608’::integer <= VALUE) AND (VALUE <= 8388607))) | SQL |
mysql.tinyint | 基于 smallint 的域 · CHECK (((’-128’::integer <= VALUE) AND (VALUE <= 127))) | SQL |
mysql.tinyint1 | 基于 smallint 的域 · CHECK (((’-128’::integer <= VALUE) AND (VALUE <= 127))) | SQL |
mysql.varbinary | 基于 bytea 的域 | SQL |
mysql.year_ | 基于 integer 的域 · CHECK (((1901 <= VALUE) AND (VALUE <= 2155))) | SQL |
元数据枚举
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mys_informa_schema.enum_collations_pad_attribute | 用于 mys_informa_schema.collations.pad_attribute。可取值为 ‘PAD SPACE’, ‘NO PAD’。 | SQL |
mys_informa_schema.enum_referential_constraints_delete_rule | 可取值为 ‘NO ACTION’, ‘RESTRICT’, ‘CASCADE’, ‘SET NULL’, ‘SET DEFAULT’。 | SQL |
mys_informa_schema.enum_referential_constraints_match_option | 可取值为 ‘NONE’, ‘PARTIAL’, ‘FULL’。 | SQL |
mys_informa_schema.enum_referential_constraints_update_rule | 可取值为 ‘NO ACTION’, ‘RESTRICT’, ‘CASCADE’, ‘SET NULL’, ‘SET DEFAULT’。 | SQL |
mys_informa_schema.enum_resource_groups_resource_group_type | 用于 mys_informa_schema.resource_groups.resource_group_type。可取值为 ‘SYSTEM’, ‘USER’。 | SQL |
mysql.enum_mysql_user | 用于 mysql.“user”.account_locked。可取值为 ‘N’, ‘Y’。 | SQL |
mysql.enum_mysql_user_ssl_type | 用于 mysql.“user”.ssl_type。可取值为 ‘’, ‘ANY’, ‘X509’, ‘SPECIFIED’。 | SQL |
mysql.enum_proc | 可取值为 ‘FUNCTION’, ‘PROCEDURE’。 | SQL |
mysql.enum_security | 可取值为 ‘INVOKER’, ‘DEFINER’。 | SQL |
performance_schema.enum_bin_log_trans_comp_stats_log_type | 用于 performance_schema.binary_log_transaction_compression_stats.log_type。可取值为 ‘BINARY’, ‘RELAY’。 | SQL |
performance_schema.enum_error_log_prio | 用于 performance_schema.error_log.prio。可取值为 ‘System’, ‘Error’, ‘Warning’, ‘Note’。 | SQL |
performance_schema.enum_evs_st_cur_nes_event_type | 用于 performance_schema.events_stages_current.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_st_his_long_nes_event_type | 用于 performance_schema.events_stages_history_long.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_st_his_nes_event_type | 用于 performance_schema.events_stages_history.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_stms_sumy_by_prg_obj_type | 用于 performance_schema.events_statements_summary_by_program.object_type。可取值为 ‘EVENT’, ‘FUNCTION’, ‘PROCEDURE’, ‘TABLE’, ‘TRIGGER’。 | SQL |
performance_schema.enum_evs_stmts_cur_exe_engine | 用于 performance_schema.events_statements_current.execution_engine。可取值为 ‘PRIMARY’, ‘SECONDARY’。 | SQL |
performance_schema.enum_evs_stmts_cur_nes_event_type | 用于 performance_schema.events_statements_current.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_stmts_his_exe_engine | 用于 performance_schema.events_statements_history.execution_engine。可取值为 ‘PRIMARY’, ‘SECONDARY’。 | SQL |
performance_schema.enum_evs_stmts_his_long_exe_engine | 用于 performance_schema.events_statements_history_long.execution_engine。可取值为 ‘PRIMARY’, ‘SECONDARY’。 | SQL |
performance_schema.enum_evs_stmts_his_long_nes_event_type | 用于 performance_schema.events_statements_history_long.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_stmts_his_nes_event_type | 用于 performance_schema.events_statements_history.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_trans_cur_access_mode | 用于 performance_schema.events_transactions_current.access_mode。可取值为 ‘READ ONLY’, ‘READ WRITE’。 | SQL |
performance_schema.enum_evs_trans_cur_autocommit | 用于 performance_schema.events_transactions_current.autocommit。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_evs_trans_cur_nes_event_type | 用于 performance_schema.events_transactions_current.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_trans_cur_state | 用于 performance_schema.events_transactions_current.state。可取值为 ‘ACTIVE’, ‘COMMITTED’, ‘ROLLED BACK’。 | SQL |
performance_schema.enum_evs_trans_his_access_mode | 用于 performance_schema.events_transactions_history.access_mode。可取值为 ‘READ ONLY’, ‘READ WRITE’。 | SQL |
performance_schema.enum_evs_trans_his_autocommit | 用于 performance_schema.events_transactions_history.autocommit。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_evs_trans_his_long_access_mode | 用于 performance_schema.events_transactions_history_long.access_mode。可取值为 ‘READ ONLY’, ‘READ WRITE’。 | SQL |
performance_schema.enum_evs_trans_his_long_autocommit | 用于 performance_schema.events_transactions_history_long.autocommit。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_evs_trans_his_long_nes_event_type | 用于 performance_schema.events_transactions_history_long.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_trans_his_long_state | 用于 performance_schema.events_transactions_history_long.state。可取值为 ‘ACTIVE’, ‘COMMITTED’, ‘ROLLED BACK’。 | SQL |
performance_schema.enum_evs_trans_his_nesting_event_type | 用于 performance_schema.events_transactions_history.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_trans_his_state | 用于 performance_schema.events_transactions_history.state。可取值为 ‘ACTIVE’, ‘COMMITTED’, ‘ROLLED BACK’。 | SQL |
performance_schema.enum_evs_waits_cur_nesting_event_type | 用于 performance_schema.events_waits_current.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_waits_his_long_nesting_event_type | 用于 performance_schema.events_waits_history_long.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_evs_waits_his_nesting_event_type | 用于 performance_schema.events_waits_history.nesting_event_type。可取值为 ‘TRANSACTION’, ‘STATEMENT’, ‘STAGE’, ‘WAIT’。 | SQL |
performance_schema.enum_host_cache_host_validated | 用于 performance_schema.host_cache.host_validated。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_perf_timers_timer_name | 用于 performance_schema.performance_timers.timer_name。可取值为 ‘CYCLE’, ‘NANOSECOND’, ‘MICROSECOND’, ‘MILLISECOND’, ‘THREAD_CPU’。 | SQL |
performance_schema.enum_pl_exe_engine | 用于 performance_schema.processlist.execution_engine。可取值为 ‘PRIMARY’, ‘SECONDARY’。 | SQL |
performance_schema.enum_pre_stmts_ins_exec_eng | 用于 performance_schema.prepared_statements_instances.execution_engine。可取值为 ‘PRIMARY’, ‘SECONDARY’。 | SQL |
performance_schema.enum_pre_stmts_ins_owner_obj_type | 用于 performance_schema.prepared_statements_instances.owner_object_type。可取值为 ‘EVENT’, ‘FUNCTION’, ‘PROCEDURE’, ‘TABLE’, ‘TRIGGER’。 | SQL |
performance_schema.enum_r_a_cn_as_gt_tott | 用于 performance_schema.replication_applier_configuration.assign_gtids_to_anonymous_transactions_type。可取值为 ‘OFF’, ‘LOCAL’, ‘UUID’。 | SQL |
performance_schema.enum_r_a_cn_re_ro_ft | 用于 performance_schema.replication_applier_configuration.require_row_format。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_r_a_cn_re_ta_pkc | 用于 performance_schema.replication_applier_configuration.require_table_primary_key_check。可取值为 ‘STREAM’, ‘ON’, ‘OFF’。 | SQL |
performance_schema.enum_r_a_f_cnf_by | 用于 performance_schema.replication_applier_filters.configured_by。可取值为 ‘STARTUP_OPTIONS’, ‘CHANGE_REPLICATION_FILTER’, ‘STARTUP_OPTIONS_FOR_CHANNEL’, ‘CHANGE_REPLICATION_FILTER_FOR_CHANNEL’。 | SQL |
performance_schema.enum_repl_al_st_by_wk_ser_state | 用于 performance_schema.replication_applier_status_by_worker.service_state。可取值为 ‘ON’, ‘OFF’。 | SQL |
performance_schema.enum_repl_app_gl_fil_cnf_by | 用于 performance_schema.replication_applier_global_filters.configured_by。可取值为 ‘STARTUP_OPTIONS’, ‘CHANGE_REPLICATION_FILTER’。 | SQL |
performance_schema.enum_repl_app_st_by_co_ser_st | 用于 performance_schema.replication_applier_status_by_coordinator.service_state。可取值为 ‘ON’, ‘OFF’。 | SQL |
performance_schema.enum_repl_app_st_ser_state | 用于 performance_schema.replication_applier_status.service_state。可取值为 ‘ON’, ‘OFF’。 | SQL |
performance_schema.enum_repl_con_conf_auto_position | 用于 performance_schema.replication_connection_configuration.auto_position。可取值为 ‘1’, ‘0’。 | SQL |
performance_schema.enum_repl_con_conf_get_public_key | 用于 performance_schema.replication_connection_configuration.get_public_key。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_repl_con_conf_gtid_only | 用于 performance_schema.replication_connection_configuration.gtid_only。可取值为 ‘1’, ‘0’。 | SQL |
performance_schema.enum_repl_con_conf_sou_con_auto_fo | 用于 performance_schema.replication_connection_configuration.source_connection_auto_failover。可取值为 ‘1’, ‘0’。 | SQL |
performance_schema.enum_repl_con_conf_ssl_allowed | 用于 performance_schema.replication_connection_configuration.ssl_allowed。可取值为 ‘YES’, ‘NO’, ‘IGNORED’。 | SQL |
performance_schema.enum_repl_con_conf_ssl_verify_svr_cert | 用于 performance_schema.replication_connection_configuration.ssl_verify_server_certificate。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_repl_con_status_service_state | 用于 performance_schema.replication_connection_status.service_state。可取值为 ‘ON’, ‘OFF’, ‘CONNECTING’。 | SQL |
performance_schema.enum_setup_actors_enabled | 用于 performance_schema.setup_actors.enabled。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_setup_actors_history | 用于 performance_schema.setup_actors.history。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_setup_consumers_enabled | 用于 performance_schema.setup_consumers.enabled。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_setup_instruments_enabled | 用于 performance_schema.setup_instruments.enabled。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_setup_instruments_timed | 用于 performance_schema.setup_instruments.timed。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_setup_objects_enabled | 用于 performance_schema.setup_objects.enabled。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_setup_objects_object_type | 用于 performance_schema.setup_objects.object_type。可取值为 ‘EVENT’, ‘FUNCTION’, ‘PROCEDURE’, ‘TABLE’, ‘TRIGGER’。 | SQL |
performance_schema.enum_setup_objects_timed | 用于 performance_schema.setup_objects.timed。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_setup_threads_enabled | 用于 performance_schema.setup_threads.enabled。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_setup_threads_history | 用于 performance_schema.setup_threads.history。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_socket_instances_state | 用于 performance_schema.socket_instances.state。可取值为 ‘IDLE’, ‘ACTIVE’。 | SQL |
performance_schema.enum_threads_execution_engine | 用于 performance_schema.threads.execution_engine。可取值为 ‘PRIMARY’, ‘SECONDARY’。 | SQL |
performance_schema.enum_threads_history | 用于 performance_schema.threads.history。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_threads_instrumented | 用于 performance_schema.threads.instrumented。可取值为 ‘YES’, ‘NO’。 | SQL |
performance_schema.enum_variables_info_variable_source | 用于 performance_schema.variables_info.variable_source。可取值为 ‘COMPILED’, ‘GLOBAL’, ‘SERVER’, ‘EXPLICIT’, ‘EXTRA’, ‘USER’, ‘LOGIN’, ‘COMMAND_LINE’, ‘PERSISTED’, ‘DYNAMIC’。 | SQL |
2.2.3 - 排序规则
查找字符比较规则或核对列的排序依赖。
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.case_insensitive | ICU 二级比较,忽略大小写。 | SQL |
mysql.case_sensitive | 采用 C 排序规则,区分大小写。 | SQL |
mysql.ignore_accents | ICU 一级比较并启用大小写层级,忽略重音。 | SQL |
mysql.utf8mb4_bin | 按 Unicode 码点排序并使用 PAD SPACE 规则。 | SQL |
mysql.utf8mb4_general_ci | 使用 MySQL general_ci 的比较权重及 PAD SPACE 规则。 | SQL |
2.2.4 - 类型转换
按源类型和目标类型查找。分组标明 PostgreSQL 可以自动采用该转换的范围。
赋值转换也可用于显式 CAST。隐式转换还可参与函数和运算符的重载解析。
赋值转换
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
"char" → double precision | 调用 mysql.convert_char_to_float8(“char”)。 | SQL |
bigint → bit varying | 调用 mysql.cast_bigint_to_varbit(bigint)。 | SQL |
bit varying → bigint | 调用 mysql.cast_varbit_to_bigint(bit varying)。 | SQL |
bit varying → integer | 调用 mysql.cast_varbit_to_int(bit varying)。 | SQL |
bit varying → smallint | 调用 mysql.cast_varbit_to_smallint(bit varying)。 | SQL |
bit → bytea | 调用 mysql.cast_bit_to_bytea(bit)。 | SQL |
bit → text | 调用 mysql.bit_to_text(bit)。 | SQL |
boolean → bigint | 调用 mysql.cast_boolean_to_bigint(boolean)。 | SQL |
boolean → bit varying | 调用 mysql.cast_bool_to_varbit(boolean)。 | SQL |
boolean → bytea | 调用 mysql.cast_boolean_to_bytea(boolean)。 | 生成定义 |
boolean → double precision | 调用 mysql.cast_boolean_to_float8(boolean)。 | 生成定义 |
boolean → mysql.binary_n | 调用 mysql.cast_boolean_to_binary_n(boolean)。 | 生成定义 |
boolean → mysql.varbinary_n | 调用 mysql.cast_boolean_to_varbinary_n(boolean)。 | 生成定义 |
boolean → numeric | 调用 mysql.cast_boolean_to_numeric(boolean)。 | 生成定义 |
boolean → real | 调用 mysql.cast_boolean_to_float4(boolean)。 | 生成定义 |
boolean → smallint | 调用 mysql.cast_boolean_to_tinyint(boolean)。 | SQL |
bytea → bit | 调用 mysql.bytea2bit(bytea)。 | SQL |
bytea → bit varying | 调用 mysql.bytea2varbit(bytea)。 | SQL |
bytea → boolean | 调用 mysql.bytea2bool(bytea)。 | SQL |
bytea → character | 调用 mysql.bytea2bpchar(bytea)。 | SQL |
bytea → character varying | 调用 mysql.bytea2varchar(bytea)。 | SQL |
bytea → date | 调用 mysql.bytea2date(bytea)。 | SQL |
bytea → double precision | 调用 mysql.bytea2float8(bytea)。 | SQL |
bytea → mysql.binary_n | 调用 mysql.binary_n(bytea,integer,boolean)。 | 生成定义 |
bytea → mysql.varbinary_n | 调用 mysql.varbinary_n(bytea,integer,boolean)。 | 生成定义 |
bytea → numeric | 调用 mysql.bytea2numeric(bytea)。 | SQL |
bytea → real | 调用 mysql.bytea2float4(bytea)。 | SQL |
bytea → text | 调用 mysql.bytea2text(bytea)。 | SQL |
bytea → time with time zone | 调用 mysql.bytea2timetz(bytea)。 | SQL |
bytea → time without time zone | 调用 mysql.bytea2time(bytea)。 | SQL |
bytea → timestamp with time zone | 调用 mysql.bytea2timestamptz(bytea)。 | SQL |
bytea → timestamp without time zone | 调用 mysql.bytea2timestamp(bytea)。 | SQL |
character varying → bigint | 调用 mysql.cast_varchar_to_bigint(character varying)。 | SQL |
character varying → double precision | 调用 mysql.convert_varchar_to_float8(character varying)。 | SQL |
character varying → integer | 调用 mysql.cast_varchar_to_int(character varying)。 | SQL |
character varying → mysql.binary_n | 调用 mysql.binary_n(character varying,integer,boolean)。 | 生成定义 |
character varying → mysql.varbinary_n | 调用 mysql.varbinary_n(character varying,integer,boolean)。 | 生成定义 |
character varying → smallint | 调用 mysql.cast_varchar_to_tinyint(character varying)。 | SQL |
character → bigint | 调用 mysql.cast_char_to_bigint(character)。 | SQL |
character → integer | 调用 mysql.cast_char_to_int(character)。 | SQL |
character → mysql.binary_n | 调用 mysql.binary_n(character,integer,boolean)。 | 生成定义 |
character → mysql.varbinary_n | 调用 mysql.varbinary_n(character,integer,boolean)。 | 生成定义 |
character → smallint | 调用 mysql.cast_char_to_tinyint(character)。 | SQL |
integer → bit varying | 调用 mysql.cast_int_to_varbit(integer)。 | SQL |
mysql.binary_n → character | 调用 mysql.binary_n_bpchar(mysql.binary_n)。 | 生成定义 |
mysql.binary_n → character varying | 调用 mysql.binary_n_varchar(mysql.binary_n)。 | 生成定义 |
mysql.binary_n → mysql.binary_n | 调用 mysql.binary_n(mysql.binary_n,integer,boolean)。 | 生成定义 |
mysql.binary_n → mysql.varbinary_n | 调用 mysql.varbinary_n(mysql.binary_n,integer,boolean)。 | 生成定义 |
mysql.binary_n → text | 调用 mysql.binary_n_text(mysql.binary_n)。 | 生成定义 |
mysql.hexlit → bigint | 调用 mysql.hexlit_int8(mysql.hexlit)。 | SQL |
mysql.hexlit → bit | 调用 mysql.hexlit_bit(mysql.hexlit,integer,boolean)。 | SQL |
mysql.hexlit → bit varying | 调用 mysql.hexlit_varbit(mysql.hexlit,integer,boolean)。 | SQL |
mysql.hexlit → boolean | 调用 mysql.hexlit_bool(mysql.hexlit)。 | SQL |
mysql.hexlit → character | 调用 mysql.hexlit_bpchar(mysql.hexlit)。 | SQL |
mysql.hexlit → character varying | 调用 mysql.hexlit_varchar(mysql.hexlit)。 | SQL |
mysql.hexlit → double precision | 调用 mysql.hexlit_float8(mysql.hexlit)。 | SQL |
mysql.hexlit → integer | 调用 mysql.hexlit_int4(mysql.hexlit)。 | SQL |
mysql.hexlit → mysql.binary_n | 调用 mysql.binary_n(mysql.hexlit,integer,boolean)。 | 生成定义 |
mysql.hexlit → mysql.varbinary_n | 调用 mysql.varbinary_n(mysql.hexlit,integer,boolean)。 | 生成定义 |
mysql.hexlit → numeric | 调用 mysql.hexlit_numeric(mysql.hexlit)。 | SQL |
mysql.hexlit → real | 调用 mysql.hexlit_float4(mysql.hexlit)。 | SQL |
mysql.hexlit → smallint | 调用 mysql.hexlit_int2(mysql.hexlit)。 | SQL |
mysql.hexlit → text | 调用 mysql.hexlit_text(mysql.hexlit)。 | SQL |
mysql.varbinary_n → character | 调用 mysql.varbinary_n_bpchar(mysql.varbinary_n)。 | 生成定义 |
mysql.varbinary_n → character varying | 调用 mysql.varbinary_n_varchar(mysql.varbinary_n)。 | 生成定义 |
mysql.varbinary_n → mysql.binary_n | 调用 mysql.binary_n(mysql.varbinary_n,integer,boolean)。 | 生成定义 |
mysql.varbinary_n → mysql.varbinary_n | 调用 mysql.varbinary_n(mysql.varbinary_n,integer,boolean)。 | 生成定义 |
mysql.varbinary_n → text | 调用 mysql.varbinary_n_text(mysql.varbinary_n)。 | 生成定义 |
smallint → bit varying | 调用 mysql.cast_smallint_to_varbit(smallint)。 | SQL |
text → bigint | 调用 mysql.cast_text_to_bigint(text)。 | SQL |
text → date | 调用 mysql.cast_text_to_date(text)。 | SQL |
text → double precision | 调用 mysql.convert_text_to_float8(text)。 | SQL |
text → integer | 调用 mysql.cast_text_to_int(text)。 | SQL |
text → mysql.binary_n | 调用 mysql.binary_n(text,integer,boolean)。 | 生成定义 |
text → mysql.varbinary_n | 调用 mysql.varbinary_n(text,integer,boolean)。 | 生成定义 |
text → smallint | 调用 mysql.cast_text_to_tinyint(text)。 | SQL |
text → time without time zone | 调用 mysql.cast_text_to_time(text)。 | SQL |
text → timestamp with time zone | 调用 mysql.cast_text_to_timestamptz(text)。 | SQL |
text → timestamp without time zone | 调用 mysql.cast_text_to_timestamp(text)。 | SQL |
time without time zone → timestamp without time zone | 调用 mysql.time_to_timestamp(time without time zone)。 | SQL |
隐式转换
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
bigint → boolean | 调用 mysql.cast_bigint_to_boolean(bigint)。 | SQL |
bit varying → boolean | 调用 mysql.cast_varbit_to_boolean(bit varying)。 | SQL |
bit → boolean | 调用 mysql.cast_bit_to_boolean(bit)。 | SQL |
mysql.binary_n → bytea | 复用原有二进制表示。 | 生成定义 |
mysql.hexlit → bytea | 复用原有二进制表示。 | SQL |
mysql.varbinary_n → bytea | 复用原有二进制表示。 | 生成定义 |
smallint → boolean | 调用 mysql.cast_smallint_to_boolean(smallint)。 | SQL |
text → interval | 调用 mysql.“interval”(text,integer)。 | SQL |
2.2.5 - 函数
按名称找到函数,再按参数类型选择重载。
前五类收录应用 SQL 可用的函数,其余各类列出供方言、运算符、索引及元数据查询使用的辅助入口。
按用途查找
| 类别 | 条目数 | 查询内容 |
|---|---|---|
| 字符串与二进制函数 | 324 | 从返回类型区分文本与字节串重载。 |
| 数值函数 | 45 | 用于取整、除法、进制转换和其他数值计算。 |
| 日期时间函数 | 162 | 用于日期运算、格式化、解析、字段提取和读取时钟。 |
| 条件函数 | 335 | 查找 IF、IFNULL 和 ISNULL 时,同时核对条件和各分支的类型。 |
| 会话函数 | 18 | 查询连接身份、当前数据库、命名锁及语句状态。 |
| 类型转换辅助函数 | 112 | 供 CAST、类型强制转换和表达式改写调用。 |
| 比较运算符实现 | 278 | 等值和顺序比较运算符使用的内部入口。 |
| 算术运算符实现 | 193 | 供不同类型的 MySQL 操作数做算术运算。 |
| 位运算与逻辑运算符实现 | 181 | 供位运算和逻辑判断调用。 |
| 模式匹配与 JSON 运算符实现 | 41 | 供 LIKE、正则表达式及 JSON 字段访问调用。 |
| 字符串与数值辅助函数 | 9 | 供子串查找、格式校验和取整使用。 |
| 日期时间辅助函数 | 15 | 供日期规格化、周编号和数值日期运算使用。 |
| 二进制与字符串存储辅助函数 | 48 | 供类型输入输出、二进制表达式求值和字符串结果转换使用。 |
| 聚合支持函数 | 12 | 聚合执行时调用的内部状态转移函数和最终函数。 |
| 索引支持函数 | 24 | 供索引访问、键比较、哈希和运算符类注册使用。 |
| 会话状态与变量辅助函数 | 16 | 供 SET、SHOW、用户变量与认证缓存管理使用。 |
| DDL 与写入辅助函数 | 15 | 供列表达式、序列和行触发器调用。 |
| SHOW 与元数据辅助函数 | 31 | 为 MySQL 客户端格式化目录值并构造结果集。 |
按函数名查找
_
_add_bool · _add_null · _calc_days_in_year · _calc_week · _calc_weekday · _convert_format_to_halo_for_number_datetime · _convert_format_to_halo_for_string_datetime · _convert_format_to_halo_for_string_number_datetime · _convert_format_to_halo_for_string_string_datetime · _date_padding · _process_for_number_datetime · _process_for_string_number_datetime · _sub_bool · _sub_null · _week_mode
A
adddate · addtime · amend_def_val · amend_def_val_for_internal · anycompatibleandbytea · anycompatiblecondandbytea · anycompatiblecondorbytea · anycompatibledivbytea · anycompatibleeqbytea · anycompatiblegebytea · anycompatiblegtbytea · anycompatiblelebytea · anycompatiblelikebytea · anycompatibleltbytea · anycompatiblemibytea · anycompatiblemodbytea · anycompatiblemulbytea · anycompatiblenebytea · anycompatiblenlikebytea · anycompatiblenonarray_or_text · anycompatiblenregexpbinbytea · anycompatiblenregexpbytea · anycompatibleorbytea · anycompatibleplbytea · anycompatibleregexpbinbytea · anycompatibleregexpbytea · anynonarray_or_text · array_to_string_for_mysql · ascii · auto_increment_advance
B
bigint_add_char · bigint_add_text · bigint_add_varchar · bigint_and_bigint · bigint_bitxor_bigint · bigint_divide_char · bigint_divide_text · bigint_divide_varchar · bigint_like_text · bigint_minus_char · bigint_minus_text · bigint_minus_varchar · bigint_mod_char · bigint_mod_text · bigint_mod_varchar · bigint_multi_char · bigint_multi_text · bigint_multi_varchar · bigint_not_like_text · bigint_or_bigint · bigint_xor_bigint · bigintbgeqtext · bigintbgtext · bigintleeqtext · bigintletext · bin · binary_n · binary_n_bpchar · binary_n_cmp · binary_n_cmp_bytea · binary_n_cmp_varbinary_n · binary_n_eq · binary_n_ge · binary_n_gt · binary_n_hash · binary_n_hash_extended · binary_n_in · binary_n_le · binary_n_lt · binary_n_ne · binary_n_out · binary_n_recv · binary_n_send · binary_n_text · binary_n_typmodin · binary_n_typmodout · binary_n_varchar · binary_regular_expr · binary_regular_expr_not · binary_truth · bit_and_varbit · bit_and_varbit_final · bit_count · bit_eq_boolean · bit_or_varbit · bit_or_varbit_final · bit_to_text · bit_xor_varbit · bit_xor_varbit_final · bool_and_int2 · bool_and_int4 · bool_and_int8 · bool_or_bool · bool_or_int2 · bool_or_int4 · bool_or_int8 · boolcondandbool · boolean_eq_bit · boolean_eq_varbit · booleqint2 · booleqint4 · booleqint8 · boolneint2 · boolneint4 · boolneint8 · bpcharlike · bpcharnlike · btrim · bytea2bit · bytea2bool · bytea2bpchar · bytea2date · bytea2float4 · bytea2float8 · bytea2int2 · bytea2int4 · bytea2int8 · bytea2numeric · bytea2text · bytea2time · bytea2timestamp · bytea2timestamptz · bytea2timetz · bytea2varbit · bytea2varchar · bytea_and_hexlit · bytea_cmp_binary_n · bytea_cmp_varbinary_n · bytea_div_hexlit · bytea_eq_hexlit · bytea_ge_hexlit · bytea_gt_hexlit · bytea_le_hexlit · bytea_like_hexlit · bytea_lt_hexlit · bytea_mi_hexlit · bytea_mod_hexlit · bytea_mul_hexlit · bytea_ne_hexlit · bytea_nlike_hexlit · bytea_nseq_hexlit · bytea_or_hexlit · bytea_pl_hexlit · bytea_shl_hexlit · bytea_shr_hexlit · bytea_xor_hexlit · byteaandanycompatible · byteaandbytea · byteacondandanycompatible · byteacondandbytea · byteacondoranycompatible · byteacondorbytea · byteadivanycompatible · byteadivbytea · byteaeqanycompatible · byteageanycompatible · byteagebytea · byteagtanycompatible · byteagtbytea · bytealeanycompatible · bytealebytea · bytealikeanycompatible · bytealtanycompatible · bytealtbytea · byteamianycompatible · byteamibytea · byteamodanycompatible · byteamodbytea · byteamulanycompatible · byteamulbytea · byteaneanycompatible · byteanlikeanycompatible · byteanregexpanycompatible · byteanregexpbinanycompatible · byteanregexpbinbytea · byteanregexpbytea · byteaoranycompatible · byteaorbytea · byteaplanycompatible · byteaplbytea · bytearegexpanycompatible · bytearegexpbinanycompatible · bytearegexpbinbytea · bytearegexpbytea
C
cast_bigint_to_boolean · cast_bigint_to_varbit · cast_bit_to_boolean · cast_bit_to_bytea · cast_bool_to_varbit · cast_boolean_to_bigint · cast_boolean_to_binary_n · cast_boolean_to_bytea · cast_boolean_to_float4 · cast_boolean_to_float8 · cast_boolean_to_numeric · cast_boolean_to_tinyint · cast_boolean_to_varbinary_n · cast_char · cast_char_to_bigint · cast_char_to_int · cast_char_to_tinyint · cast_int_to_varbit · cast_numeric_source · cast_smallint_to_boolean · cast_smallint_to_varbit · cast_text_to_bigint · cast_text_to_date · cast_text_to_int · cast_text_to_time · cast_text_to_timestamp · cast_text_to_timestamptz · cast_text_to_tinyint · cast_varbit_to_bigint · cast_varbit_to_boolean · cast_varbit_to_int · cast_varbit_to_smallint · cast_varchar_to_bigint · cast_varchar_to_int · cast_varchar_to_tinyint · ceil · ceil_for_mysql · ceiling · char_add_bigint · char_add_char · char_divide_bigint · char_divide_char · char_eq_char_for_date_format · char_length · char_minus_bigint · char_minus_char · char_mod_bigint · char_mod_char · char_multi_bigint · char_multi_char · character_length · check_set · clear_user_variables · column_default · column_domain · column_extra · column_generation · concat · concat_one · concat_pair · concat_ws · concat_ws_bytes · connection_id · conv · convert_bigint_to_varbit · convert_char_to_float8 · convert_date_to_float8 · convert_digit_text_to_text_for_mysql · convert_int_to_varbit · convert_smallint_to_varbit · convert_text_hex_to_text_varbit · convert_text_to_bigint_for_mysql · convert_text_to_digit_text_for_mysql · convert_text_to_float8 · convert_text_to_int8 · convert_text_varbit_to_bigint · convert_time_text_to_numeric_for_mysql · convert_time_to_float8 · convert_timestamp_to_float8 · convert_to_time_format · convert_tz · convert_using · convert_varbit_to_bigint · convert_varbit_to_int · convert_varbit_to_smallint · convert_varchar_to_float8 · curdate · curdate_add · curdate_sub · current_user · curtime
D
database · date · date_add · date_add_bigint · date_add_int · date_add_smallint · date_eq_text · date_format · date_ge_text · date_gt_text · date_le_text · date_lt_text · date_minus_bigint · date_minus_int · date_minus_smallint · date_ne_text · date_sub · datediff · dateeqtext · datenetext · day · dayname · dayofmonth · dayofweek · dayofyear · decimal_column_type · decimal_ps · div_float4_float4 · div_float4_float8 · div_float8_float4 · div_float8_float8 · div_float8_text · div_int2_int2 · div_int2_int4 · div_int2_int8 · div_int4_int2 · div_int4_int4 · div_int4_int8 · div_int8_int2 · div_int8_int4 · div_int8_int8 · div_text_float8 · div_text_text · dummy_min_finalfunc_for_bytea · dummy_min_sfunc_for_bytea
E
elt · elt_index · export_set · extract
F
field · find_in_set · float8_and_hexlit · float8_div_hexlit · float8_eq_hexlit · float8_ge_hexlit · float8_gt_hexlit · float8_le_hexlit · float8_lt_hexlit · float8_mi_hexlit · float8_mod_hexlit · float8_mul_hexlit · float8_ne_hexlit · float8_nseq_hexlit · float8_or_hexlit · float8_pl_hexlit · float8_shl_hexlit · float8_shr_hexlit · float8_xor_hexlit · floor · floor_for_mysql · flush_auth_cache · format · found_rows · from_days · from_unixtime
G
generated_column · generated_numeric · generated_value · generated_varchar · get_column_extra · get_column_key · get_func_def · get_funcs_procs_parameters · get_lock · get_mysql_proc_arg_mode · get_mysql_type_name · get_proc_def · get_seq_in_index · get_system_global_variable · get_system_session_variable · get_system_variable · get_user_var · getenv
H
hex · hexlit_and_bytea · hexlit_and_float8 · hexlit_and_hexlit · hexlit_and_int2 · hexlit_and_int4 · hexlit_and_int8 · hexlit_and_numeric · hexlit_and_text · hexlit_and_varbit · hexlit_bit · hexlit_bool · hexlit_bpchar · hexlit_cmp · hexlit_cmp_support · hexlit_div_bytea · hexlit_div_float8 · hexlit_div_hexlit · hexlit_div_int2 · hexlit_div_int4 · hexlit_div_int8 · hexlit_div_numeric · hexlit_div_text · hexlit_div_varbit · hexlit_eq · hexlit_eq_bytea · hexlit_eq_float8 · hexlit_eq_int2 · hexlit_eq_int4 · hexlit_eq_int8 · hexlit_eq_numeric · hexlit_eq_text · hexlit_eq_varbit · hexlit_float4 · hexlit_float8 · hexlit_ge · hexlit_ge_bytea · hexlit_ge_float8 · hexlit_ge_int2 · hexlit_ge_int4 · hexlit_ge_int8 · hexlit_ge_numeric · hexlit_ge_text · hexlit_ge_varbit · hexlit_gt · hexlit_gt_bytea · hexlit_gt_float8 · hexlit_gt_int2 · hexlit_gt_int4 · hexlit_gt_int8 · hexlit_gt_numeric · hexlit_gt_text · hexlit_gt_varbit · hexlit_hash · hexlit_hash_extended · hexlit_in · hexlit_int2 · hexlit_int4 · hexlit_int8 · hexlit_le · hexlit_le_bytea · hexlit_le_float8 · hexlit_le_int2 · hexlit_le_int4 · hexlit_le_int8 · hexlit_le_numeric · hexlit_le_text · hexlit_le_varbit · hexlit_like · hexlit_like_bytea · hexlit_like_text · hexlit_lt · hexlit_lt_bytea · hexlit_lt_float8 · hexlit_lt_int2 · hexlit_lt_int4 · hexlit_lt_int8 · hexlit_lt_numeric · hexlit_lt_text · hexlit_lt_varbit · hexlit_mi_bytea · hexlit_mi_float8 · hexlit_mi_hexlit · hexlit_mi_int2 · hexlit_mi_int4 · hexlit_mi_int8 · hexlit_mi_numeric · hexlit_mi_text · hexlit_mi_varbit · hexlit_mod_bytea · hexlit_mod_float8 · hexlit_mod_hexlit · hexlit_mod_int2 · hexlit_mod_int4 · hexlit_mod_int8 · hexlit_mod_numeric · hexlit_mod_text · hexlit_mod_varbit · hexlit_mul_bytea · hexlit_mul_float8 · hexlit_mul_hexlit · hexlit_mul_int2 · hexlit_mul_int4 · hexlit_mul_int8 · hexlit_mul_numeric · hexlit_mul_text · hexlit_mul_varbit · hexlit_ne · hexlit_ne_bytea · hexlit_ne_float8 · hexlit_ne_int2 · hexlit_ne_int4 · hexlit_ne_int8 · hexlit_ne_numeric · hexlit_ne_text · hexlit_ne_varbit · hexlit_nlike · hexlit_nlike_bytea · hexlit_nlike_text · hexlit_not · hexlit_nseq_bytea · hexlit_nseq_float8 · hexlit_nseq_hexlit · hexlit_nseq_int2 · hexlit_nseq_int4 · hexlit_nseq_int8 · hexlit_nseq_numeric · hexlit_nseq_text · hexlit_nseq_varbit · hexlit_numeric · hexlit_or_bytea · hexlit_or_float8 · hexlit_or_hexlit · hexlit_or_int2 · hexlit_or_int4 · hexlit_or_int8 · hexlit_or_numeric · hexlit_or_text · hexlit_or_varbit · hexlit_out · hexlit_pl_bytea · hexlit_pl_float8 · hexlit_pl_hexlit · hexlit_pl_int2 · hexlit_pl_int4 · hexlit_pl_int8 · hexlit_pl_numeric · hexlit_pl_text · hexlit_pl_varbit · hexlit_recv · hexlit_send · hexlit_shl_bytea · hexlit_shl_float8 · hexlit_shl_hexlit · hexlit_shl_int2 · hexlit_shl_int4 · hexlit_shl_int8 · hexlit_shl_numeric · hexlit_shl_text · hexlit_shl_varbit · hexlit_shr_bytea · hexlit_shr_float8 · hexlit_shr_hexlit · hexlit_shr_int2 · hexlit_shr_int4 · hexlit_shr_int8 · hexlit_shr_numeric · hexlit_shr_text · hexlit_shr_varbit · hexlit_text · hexlit_um · hexlit_varbit · hexlit_varchar · hexlit_xor_bytea · hexlit_xor_float8 · hexlit_xor_hexlit · hexlit_xor_int2 · hexlit_xor_int4 · hexlit_xor_int8 · hexlit_xor_numeric · hexlit_xor_text · hexlit_xor_varbit · hour
I
if · ifnull · index_key_name · index_key_parts · insert · instr · int2_and_bool · int2_and_hexlit · int2_and_int2 · int2_and_int4 · int2_and_int8 · int2_div_hexlit · int2_eq_hexlit · int2_eq_varbit · int2_ge_hexlit · int2_gt_hexlit · int2_le_hexlit · int2_lt_hexlit · int2_mi_hexlit · int2_mod_hexlit · int2_mul_hexlit · int2_ne_hexlit · int2_nseq_hexlit · int2_or_bool · int2_or_hexlit · int2_or_int2 · int2_or_int4 · int2_or_int8 · int2_pl_hexlit · int2_shl_hexlit · int2_shr_hexlit · int2_xor_hexlit · int2andint4 · int2andint8 · int2andnumeric · int2eqbool · int2leftmoveint2 · int2leftmoveint4 · int2leftmoveint8 · int2nebool · int2orint4 · int2orint8 · int2ornumeric · int2rightmoveint2 · int2rightmoveint4 · int2rightmoveint8 · int4_and_bool · int4_and_hexlit · int4_and_int2 · int4_and_int4 · int4_and_int8 · int4_div_hexlit · int4_eq_hexlit · int4_eq_varbit · int4_ge_hexlit · int4_gt_hexlit · int4_le_hexlit · int4_lt_hexlit · int4_mi_hexlit · int4_mod_hexlit · int4_mul_hexlit · int4_ne_hexlit · int4_nseq_hexlit · int4_or_bool · int4_or_hexlit · int4_or_int2 · int4_or_int4 · int4_or_int8 · int4_pl_hexlit · int4_shl_hexlit · int4_shr_hexlit · int4_xor_hexlit · int4andint2 · int4andint8 · int4andnumeric · int4andtext · int4eqbool · int4leftmoveint2 · int4leftmoveint4 · int4leftmoveint8 · int4nebool · int4orint2 · int4orint8 · int4ornumeric · int4rightmoveint2 · int4rightmoveint4 · int4rightmoveint8 · int8_and_bool · int8_and_hexlit · int8_and_int2 · int8_and_int4 · int8_div_hexlit · int8_eq_hexlit · int8_eq_varbit · int8_ge_hexlit · int8_gt_hexlit · int8_le_hexlit · int8_lt_hexlit · int8_mi_hexlit · int8_mod_hexlit · int8_mul_hexlit · int8_ne_hexlit · int8_nseq_hexlit · int8_or_bool · int8_or_hexlit · int8_or_int2 · int8_or_int4 · int8_pl_hexlit · int8_shl_hexlit · int8_shr_hexlit · int8_xor_hexlit · int8andint2 · int8andint4 · int8andnumeric · int8eqbool · int8leftmoveint2 · int8leftmoveint4 · int8leftmoveint8 · int8nebool · int8orint2 · int8orint4 · int8ornumeric · int8rightmoveint2 · int8rightmoveint4 · int8rightmoveint8 · int_div · integerbgeqtext · integerbgtext · integerleeqtext · integerletext · interval · interval_pl_text · is_and_eq · is_free_lock · is_numeric · is_used_lock · is_valid_binary · is_valid_hex · isnull
J
json_object_field · json_unquote
L
last_day · last_insert_id · lcase · left · length · lenient_float8 · lenient_int · lenient_numeric · lenient_varchar · load_file · locate · log · log2 · lower · lpad · ltrim
M
make_set · makedate · maketime · microsecond · mid · minute · mod · mod_int2_int2 · mod_int2_int4 · mod_int2_int8 · mod_int4_int2 · mod_int4_int4 · mod_int4_int8 · mod_int8_int2 · mod_int8_int4 · mod_int8_int8 · month · monthname · mys_div_float8 · mys_div_int8 · mys_div_numeric · mys_mod_int8 · mys_mod_numeric · mys_uint64_bitnot · mys_uint64_bitop
N
now · numeric_and_hexlit · numeric_div_hexlit · numeric_eq_hexlit · numeric_ge_hexlit · numeric_gt_hexlit · numeric_le_hexlit · numeric_lt_hexlit · numeric_mi_hexlit · numeric_mod_hexlit · numeric_mul_hexlit · numeric_ne_hexlit · numeric_nseq_hexlit · numeric_or_hexlit · numeric_pl_hexlit · numeric_shl_hexlit · numeric_shr_hexlit · numeric_timestamp · numeric_xor_hexlit · numericandint2 · numericandint4 · numericandint8 · numericbgeqtext · numericbgtext · numericeqtext · numericleeqtext · numericletext · numericnetext · numericorint2 · numericorint4 · numericorint8
O
octet_length · on_update_current_timestamp
P
part_list_columns · pending_fk_definitions · pending_fk_guard · period_add · period_diff · prefix_1042_cmp · prefix_17_cmp · prefix_25_cmp · prefix_53875699983efc79eeb9e023e66605f5_cmp · prefix_b8aba7e65857eaf6a91ca737fb14b87b_cmp · prefix_handler · prefix_like · prefix_not_like · prefix_options
Q
R
rand · raw_bytes · register_prefix_binary · register_prefix_type · regular_expr · regular_expr_not · release_all_locks · release_lock · replace · right · round · row_count · rpad · rtrim
S
schema · sec_to_time · second · session_user · set_system_charset_variable · set_system_global_variable · set_system_names_variable · set_system_session_variable · set_system_variable · set_user_var · set_user_var_in_expr · setval · show_create_function · show_create_procedure · show_create_table · show_create_table_impl · show_create_trigger · show_create_view · show_create_view_impl · show_diagnostics · show_system_variable · show_table_columns · show_table_full_columns · show_table_indexs · show_table_indexs_for_8 · sleep · smallintbgeqtext · smallintbgtext · smallintleeqtext · smallintletext · space · sqrt · str_to_date · str_to_double · strcmp · string_result · subdate · substr · substring · substring_index · subtime · sum_bool · sum_text · sum_text_final · sysdate
T
text_add_bigint · text_add_text · text_and_hexlit · text_and_text · text_avg_accum · text_div_hexlit · text_divide_bigint · text_divide_text · text_eq_date · text_eq_hexlit · text_eq_time · text_eq_timestamp · text_eq_timestamptz · text_ge_date · text_ge_hexlit · text_ge_time · text_ge_timestamp · text_ge_timestamptz · text_gt_date · text_gt_hexlit · text_gt_time · text_gt_timestamp · text_gt_timestamptz · text_instr · text_le_date · text_le_hexlit · text_le_time · text_le_timestamp · text_le_timestamptz · text_like_bigint · text_like_hexlit · text_locate2 · text_locate3 · text_lt_date · text_lt_hexlit · text_lt_time · text_lt_timestamp · text_lt_timestamptz · text_mi_hexlit · text_mi_interval · text_minus_bigint · text_minus_text · text_mod_bigint · text_mod_hexlit · text_mod_text · text_mul_hexlit · text_multi_bigint · text_multi_text · text_ne_date · text_ne_hexlit · text_ne_time · text_ne_timestamp · text_ne_timestamptz · text_nlike_hexlit · text_not_like_bigint · text_nseq_hexlit · text_or_anycompatiblenonarray · text_or_anynoarray · text_or_hexlit · text_or_text · text_pl_hexlit · text_pl_interval · text_shl_hexlit · text_shr_hexlit · text_xor_hexlit · textbgbigint · textbgeqbigint · textbgeqinteger · textbgeqnumeric · textbgeqsmallint · textbginteger · textbgnumeric · textbgsmallint · texteq · texteqdate · texteqnumeric · texteqtime · texteqtimestamp · textlebigint · textleeqbigint · textleeqinteger · textleeqnumeric · textleeqsmallint · textleinteger · textlenumeric · textlesmallint · textne · textnedate · textnenumeric · textnetime · textnetimestamp · time_add_bigint · time_eq_text · time_format · time_ge_text · time_gt_text · time_le_text · time_lt_text · time_minus_bigint · time_ne_text · time_to_sec · time_to_timestamp · timediff · timeeqtext · timenetext · timestamp · timestamp_add_bigint · timestamp_eq_text · timestamp_ge_text · timestamp_gt_text · timestamp_le_text · timestamp_lt_text · timestamp_minus_bigint · timestamp_ne_text · timestampadd · timestampdiff · timestampeqtext · timestampnetext · timestamptz_eq_text · timestamptz_ge_text · timestamptz_gt_text · timestamptz_le_text · timestamptz_lt_text · timestamptz_ne_text · to_days · truncate
U
ucase · unhex · unix_timestamp · upper · user · utc_date · utc_time · utc_timestamp · uuid · uuid_short
V
varbinary_n · varbinary_n_bpchar · varbinary_n_cmp · varbinary_n_cmp_binary_n · varbinary_n_cmp_bytea · varbinary_n_eq · varbinary_n_ge · varbinary_n_gt · varbinary_n_hash · varbinary_n_hash_extended · varbinary_n_in · varbinary_n_le · varbinary_n_lt · varbinary_n_ne · varbinary_n_out · varbinary_n_recv · varbinary_n_send · varbinary_n_text · varbinary_n_typmodin · varbinary_n_typmodout · varbinary_n_varchar · varbit_and_hexlit · varbit_div_hexlit · varbit_eq_boolean · varbit_eq_hexlit · varbit_eq_int2 · varbit_eq_int4 · varbit_eq_int8 · varbit_ge_hexlit · varbit_gt_hexlit · varbit_le_hexlit · varbit_lt_hexlit · varbit_mi_hexlit · varbit_mod_hexlit · varbit_mul_hexlit · varbit_ne_hexlit · varbit_nseq_hexlit · varbit_numeric · varbit_or_hexlit · varbit_pl_hexlit · varbit_shl_hexlit · varbit_shr_hexlit · varbit_xor_hexlit · varchar_add_bigint · varchar_add_varchar · varchar_divide_bigint · varchar_divide_varchar · varchar_minus_bigint · varchar_minus_varchar · varchar_mod_bigint · varchar_mod_varchar · varchar_multi_bigint · varchar_multi_varchar · version
W
week · weekday · weekofyear
Y
2.2.5.1 - 字符串与二进制函数
从返回类型区分文本与字节串重载。
ascii
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.ascii(bytea) → integer | 取首字节的数值。 | 生成定义 · C |
mysql.ascii(mysql.binary_n) → integer | 取首字节的数值。 | 生成定义 · C |
mysql.ascii(mysql.hexlit) → integer | 取首字节的数值。 | 生成定义 · C |
mysql.ascii(mysql.varbinary_n) → integer | 取首字节的数值。 | 生成定义 · C |
bin
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.bin(bigint) → text | 将整数表示为二进制数字串。 | SQL |
btrim
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.btrim(bytea) → bytea | 裁剪字节串两端。 | 生成定义 · C |
mysql.btrim(bytea, "any") → bytea | 裁剪字节串两端。 | 生成定义 · C |
mysql.btrim(mysql.binary_n) → bytea | 裁剪字节串两端。 | 生成定义 · C |
mysql.btrim(mysql.binary_n, "any") → bytea | 裁剪字节串两端。 | 生成定义 · C |
mysql.btrim(mysql.hexlit) → bytea | 裁剪字节串两端。 | 生成定义 · C |
mysql.btrim(mysql.hexlit, "any") → bytea | 裁剪字节串两端。 | 生成定义 · C |
mysql.btrim(mysql.varbinary_n) → bytea | 裁剪字节串两端。 | 生成定义 · C |
mysql.btrim(mysql.varbinary_n, "any") → bytea | 裁剪字节串两端。 | 生成定义 · C |
char_length
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.char_length(bytea) → integer | 计算文本的字符数或二进制串的字节数。 | 生成定义 |
mysql.char_length(mysql.binary_n) → integer | 计算文本的字符数或二进制串的字节数。 | 生成定义 |
mysql.char_length(mysql.hexlit) → integer | 计算文本的字符数或二进制串的字节数。 | 生成定义 |
mysql.char_length(mysql.varbinary_n) → integer | 计算文本的字符数或二进制串的字节数。 | 生成定义 |
character_length
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.character_length(bytea) → integer | 计算文本的字符数或二进制串的字节数。 | 生成定义 |
mysql.character_length(mysql.binary_n) → integer | 计算文本的字符数或二进制串的字节数。 | 生成定义 |
mysql.character_length(mysql.hexlit) → integer | 计算文本的字符数或二进制串的字节数。 | 生成定义 |
mysql.character_length(mysql.varbinary_n) → integer | 计算文本的字符数或二进制串的字节数。 | 生成定义 |
concat
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.concat(VARIADIC "any") → text | 按参数顺序拼接字符串。 | SQL · C |
concat_ws
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.concat_ws(text, VARIADIC "any") → text | 用指定分隔符连接各项。 | SQL · C |
elt
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.elt(VARIADIC "any") → text | 返回指定位置的字符串,位置从 1 开始。 | SQL · C |
export_set
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.export_set(bigint, text, text, text, bigint) → text | 按位将置位和未置位的值转换成指定字符串。 | SQL |
field
find_in_set
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.find_in_set(bigint, text) → integer | 返回值在逗号分隔列表中的位置。 | SQL |
mysql.find_in_set(text, text) → integer | 返回值在逗号分隔列表中的位置。 | SQL |
format
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.format(numeric, bigint) → text | 按指定小数位数格式化数值。 | SQL |
hex
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.hex(bigint) → text | 将值编码为十六进制。 | SQL · C |
mysql.hex(bit varying) → text | 将值编码为十六进制。 | SQL · C |
mysql.hex(boolean) → text | 将值编码为十六进制。 | SQL |
mysql.hex(bytea) → text | 将值编码为十六进制。 | SQL · C |
mysql.hex(character) → text | 将值编码为十六进制。 | SQL · C |
mysql.hex(double precision) → text | 将值编码为十六进制。 | SQL · C |
mysql.hex(integer) → text | 将值编码为十六进制。 | SQL |
mysql.hex(mysql.binary_n) → text | 将值编码为十六进制。 | 生成定义 · C |
mysql.hex(mysql.hexlit) → text | 将值编码为十六进制。 | 生成定义 · C |
mysql.hex(mysql.varbinary_n) → text | 将值编码为十六进制。 | 生成定义 · C |
mysql.hex(numeric) → text | 将值编码为十六进制。 | SQL · C |
mysql.hex(smallint) → text | 将值编码为十六进制。 | SQL |
mysql.hex(text) → text | 将值编码为十六进制。 | SQL · C |
insert
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.insert(text, integer, integer, text) → text | 从指定位置替换一段字符串。 | SQL |
instr
json_unquote
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.json_unquote(json) → text | 去除 JSON 字符串的引号并解码。 | SQL |
lcase
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.lcase(bigint) → text | 将文本转为小写;二进制串保留原字节。 | SQL |
mysql.lcase(bytea) → bytea | 将文本转为小写;二进制串保留原字节。 | 生成定义 · C |
mysql.lcase(date) → text | 将文本转为小写;二进制串保留原字节。 | SQL |
mysql.lcase(integer) → text | 将文本转为小写;二进制串保留原字节。 | SQL |
mysql.lcase(mysql."smallint") → text | 将文本转为小写;二进制串保留原字节。 | SQL |
mysql.lcase(mysql.binary_n) → bytea | 将文本转为小写;二进制串保留原字节。 | 生成定义 · C |
mysql.lcase(mysql.hexlit) → bytea | 将文本转为小写;二进制串保留原字节。 | 生成定义 · C |
mysql.lcase(mysql.varbinary_n) → bytea | 将文本转为小写;二进制串保留原字节。 | 生成定义 · C |
mysql.lcase(numeric) → text | 将文本转为小写;二进制串保留原字节。 | SQL |
mysql.lcase(text) → text | 将文本转为小写;二进制串保留原字节。 | SQL |
mysql.lcase(time without time zone) → text | 将文本转为小写;二进制串保留原字节。 | SQL |
mysql.lcase(timestamp with time zone) → text | 将文本转为小写;二进制串保留原字节。 | SQL |
mysql.lcase(timestamp without time zone) → text | 将文本转为小写;二进制串保留原字节。 | SQL |
left
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."left"(bigint, integer) → text | 按指定长度截取前缀。 | SQL |
mysql."left"(bytea, integer) → bytea | 按指定长度截取前缀。 | 生成定义 · C |
mysql."left"(date, integer) → text | 按指定长度截取前缀。 | SQL |
mysql."left"(integer, integer) → text | 按指定长度截取前缀。 | SQL |
mysql."left"(mysql."smallint", integer) → text | 按指定长度截取前缀。 | SQL |
mysql."left"(mysql.binary_n, integer) → bytea | 按指定长度截取前缀。 | 生成定义 · C |
mysql."left"(mysql.hexlit, integer) → bytea | 按指定长度截取前缀。 | 生成定义 · C |
mysql."left"(mysql.varbinary_n, integer) → bytea | 按指定长度截取前缀。 | 生成定义 · C |
mysql."left"(text, integer) → text | 按指定长度截取前缀。 | SQL · C |
mysql."left"(time without time zone, integer) → text | 按指定长度截取前缀。 | SQL |
mysql."left"(timestamp with time zone, integer) → text | 按指定长度截取前缀。 | SQL |
mysql."left"(timestamp without time zone, integer) → text | 按指定长度截取前缀。 | SQL |
length
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.length(bytea) → integer | 计算字符串表示的字节数。 | 生成定义 |
mysql.length(mysql.binary_n) → integer | 计算字符串表示的字节数。 | 生成定义 |
mysql.length(mysql.hexlit) → integer | 计算字符串表示的字节数。 | 生成定义 |
mysql.length(mysql.varbinary_n) → integer | 计算字符串表示的字节数。 | 生成定义 |
mysql.length(num bigint) → integer | 计算字符串表示的字节数。 | SQL |
mysql.length(num character) → integer | 计算字符串表示的字节数。 | SQL |
mysql.length(num integer) → integer | 计算字符串表示的字节数。 | SQL |
mysql.length(num mysql."smallint") → integer | 计算字符串表示的字节数。 | SQL |
mysql.length(num numeric) → integer | 计算字符串表示的字节数。 | SQL |
mysql.length(text) → integer | 计算字符串表示的字节数。 | SQL |
load_file
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.load_file(text) → text | 读取服务器上的文件,需要执行权限。 | SQL |
locate
lower
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.lower(bytea) → bytea | 将文本转为小写;二进制串保留原字节。 | 生成定义 · C |
mysql.lower(mysql.binary_n) → bytea | 将文本转为小写;二进制串保留原字节。 | 生成定义 · C |
mysql.lower(mysql.hexlit) → bytea | 将文本转为小写;二进制串保留原字节。 | 生成定义 · C |
mysql.lower(mysql.varbinary_n) → bytea | 将文本转为小写;二进制串保留原字节。 | 生成定义 · C |
lpad
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.lpad(bigint, integer, text) → text | 从左侧填充到指定长度。 | SQL |
mysql.lpad(text, integer, text) → text | 从左侧填充到指定长度。 | SQL |
ltrim
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.ltrim(bytea) → bytea | 裁剪字节串的开头。 | 生成定义 · C |
mysql.ltrim(bytea, "any") → bytea | 裁剪字节串的开头。 | 生成定义 · C |
mysql.ltrim(mysql.binary_n) → bytea | 裁剪字节串的开头。 | 生成定义 · C |
mysql.ltrim(mysql.binary_n, "any") → bytea | 裁剪字节串的开头。 | 生成定义 · C |
mysql.ltrim(mysql.hexlit) → bytea | 裁剪字节串的开头。 | 生成定义 · C |
mysql.ltrim(mysql.hexlit, "any") → bytea | 裁剪字节串的开头。 | 生成定义 · C |
mysql.ltrim(mysql.varbinary_n) → bytea | 裁剪字节串的开头。 | 生成定义 · C |
mysql.ltrim(mysql.varbinary_n, "any") → bytea | 裁剪字节串的开头。 | 生成定义 · C |
make_set
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.make_set(bigint, VARIADIC text[]) → text | 按掩码中置位的位置选取字符串。 | SQL |
mid
octet_length
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.octet_length(bytea) → integer | 计算字符串表示的字节数。 | 生成定义 |
mysql.octet_length(mysql.binary_n) → integer | 计算字符串表示的字节数。 | 生成定义 |
mysql.octet_length(mysql.hexlit) → integer | 计算字符串表示的字节数。 | 生成定义 |
mysql.octet_length(mysql.varbinary_n) → integer | 计算字符串表示的字节数。 | 生成定义 |
replace
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.replace(bytea, "any", "any") → bytea | 替换字符串中出现的匹配项。 | 生成定义 · C |
mysql.replace(mysql.binary_n, "any", "any") → bytea | 替换字符串中出现的匹配项。 | 生成定义 · C |
mysql.replace(mysql.hexlit, "any", "any") → bytea | 替换字符串中出现的匹配项。 | 生成定义 · C |
mysql.replace(mysql.varbinary_n, "any", "any") → bytea | 替换字符串中出现的匹配项。 | 生成定义 · C |
mysql.replace(text, text, text) → text | 替换字符串中出现的匹配项。 | SQL · C |
right
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."right"(bigint, integer) → text | 按指定长度截取后缀。 | SQL |
mysql."right"(bytea, integer) → bytea | 按指定长度截取后缀。 | 生成定义 · C |
mysql."right"(date, integer) → text | 按指定长度截取后缀。 | SQL |
mysql."right"(integer, integer) → text | 按指定长度截取后缀。 | SQL |
mysql."right"(mysql."smallint", integer) → text | 按指定长度截取后缀。 | SQL |
mysql."right"(mysql.binary_n, integer) → bytea | 按指定长度截取后缀。 | 生成定义 · C |
mysql."right"(mysql.hexlit, integer) → bytea | 按指定长度截取后缀。 | 生成定义 · C |
mysql."right"(mysql.varbinary_n, integer) → bytea | 按指定长度截取后缀。 | 生成定义 · C |
mysql."right"(numeric, integer) → text | 按指定长度截取后缀。 | SQL |
mysql."right"(text, integer) → text | 按指定长度截取后缀。 | SQL · C |
mysql."right"(time without time zone, integer) → text | 按指定长度截取后缀。 | SQL |
mysql."right"(timestamp with time zone, integer) → text | 按指定长度截取后缀。 | SQL |
mysql."right"(timestamp without time zone, integer) → text | 按指定长度截取后缀。 | SQL |
rpad
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.rpad(bigint, integer, text) → text | 从右侧填充到指定长度。 | SQL |
mysql.rpad(text, integer, text) → text | 从右侧填充到指定长度。 | SQL |
rtrim
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.rtrim(bytea) → bytea | 裁剪字节串的末尾。 | 生成定义 · C |
mysql.rtrim(bytea, "any") → bytea | 裁剪字节串的末尾。 | 生成定义 · C |
mysql.rtrim(mysql.binary_n) → bytea | 裁剪字节串的末尾。 | 生成定义 · C |
mysql.rtrim(mysql.binary_n, "any") → bytea | 裁剪字节串的末尾。 | 生成定义 · C |
mysql.rtrim(mysql.hexlit) → bytea | 裁剪字节串的末尾。 | 生成定义 · C |
mysql.rtrim(mysql.hexlit, "any") → bytea | 裁剪字节串的末尾。 | 生成定义 · C |
mysql.rtrim(mysql.varbinary_n) → bytea | 裁剪字节串的末尾。 | 生成定义 · C |
mysql.rtrim(mysql.varbinary_n, "any") → bytea | 裁剪字节串的末尾。 | 生成定义 · C |
space
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.space(integer) → text | 生成指定个数的空格。 | SQL |
strcmp
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.strcmp(text, text) → integer | 比较两个字符串并返回顺序关系。 | SQL |
substr
substring
substring_index
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.substring_index(text, text, integer) → text | 按分隔符出现的次数截取字符串。 | SQL · C |
ucase
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.ucase(bigint) → text | 将文本转为大写;二进制串保留原字节。 | SQL |
mysql.ucase(bytea) → bytea | 将文本转为大写;二进制串保留原字节。 | 生成定义 · C |
mysql.ucase(date) → text | 将文本转为大写;二进制串保留原字节。 | SQL |
mysql.ucase(integer) → text | 将文本转为大写;二进制串保留原字节。 | SQL |
mysql.ucase(mysql."smallint") → text | 将文本转为大写;二进制串保留原字节。 | SQL |
mysql.ucase(mysql.binary_n) → bytea | 将文本转为大写;二进制串保留原字节。 | 生成定义 · C |
mysql.ucase(mysql.hexlit) → bytea | 将文本转为大写;二进制串保留原字节。 | 生成定义 · C |
mysql.ucase(mysql.varbinary_n) → bytea | 将文本转为大写;二进制串保留原字节。 | 生成定义 · C |
mysql.ucase(numeric) → text | 将文本转为大写;二进制串保留原字节。 | SQL |
mysql.ucase(text) → text | 将文本转为大写;二进制串保留原字节。 | SQL |
mysql.ucase(time without time zone) → text | 将文本转为大写;二进制串保留原字节。 | SQL |
mysql.ucase(timestamp with time zone) → text | 将文本转为大写;二进制串保留原字节。 | SQL |
mysql.ucase(timestamp without time zone) → text | 将文本转为大写;二进制串保留原字节。 | SQL |
unhex
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.unhex(bigint) → bytea | 将十六进制数字解码为字节。 | SQL |
mysql.unhex(bytea) → bytea | 将十六进制数字解码为字节。 | SQL · C |
mysql.unhex(text) → bytea | 将十六进制数字解码为字节。 | SQL · C |
upper
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.upper(bytea) → bytea | 将文本转为大写;二进制串保留原字节。 | 生成定义 · C |
mysql.upper(mysql.binary_n) → bytea | 将文本转为大写;二进制串保留原字节。 | 生成定义 · C |
mysql.upper(mysql.hexlit) → bytea | 将文本转为大写;二进制串保留原字节。 | 生成定义 · C |
mysql.upper(mysql.varbinary_n) → bytea | 将文本转为大写;二进制串保留原字节。 | 生成定义 · C |
2.2.5.2 - 数值函数
用于取整、除法、进制转换和其他数值计算。
bit_count
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.bit_count(bigint) → integer | 统计置为 1 的位数。 | SQL |
mysql.bit_count(bytea) → integer | 统计置为 1 的位数。 | SQL |
mysql.bit_count(text) → integer | 统计置为 1 的位数。 | SQL |
ceil
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.ceil(text) → bigint | 向上取整。 | SQL |
ceiling
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.ceiling(text) → bigint | 向上取整。 | SQL |
conv
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.conv(bigint, integer, integer) → text | 在指定进制之间转换数字。 | SQL |
mysql.conv(text, integer, integer) → text | 在指定进制之间转换数字。 | SQL |
floor
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.floor(text) → bigint | 向下取整。 | SQL |
int_div
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.int_div(mysql.hexlit, mysql.hexlit) → bigint | 计算 MySQL DIV 的整数商。 | SQL |
mysql.int_div(mysql.hexlit, numeric) → bigint | 计算 MySQL DIV 的整数商。 | SQL |
mysql.int_div(numeric, mysql.hexlit) → bigint | 计算 MySQL DIV 的整数商。 | SQL |
mysql.int_div(numeric, numeric) → bigint | 计算 MySQL DIV 的整数商。 | SQL |
log
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.log(bigint) → numeric | 计算对数。 | SQL |
mysql.log(integer) → numeric | 计算对数。 | SQL |
mysql.log(numeric) → numeric | 计算对数。 | SQL |
mysql.log(smallint) → numeric | 计算对数。 | SQL |
log2
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.log2(double precision) → numeric | 计算以 2 为底的对数。 | SQL |
mysql.log2(numeric) → numeric | 计算以 2 为底的对数。 | SQL |
mod
rand
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.rand() → numeric | 生成伪随机数。 | SQL |
mysql.rand(bigint) → numeric | 生成伪随机数。 | SQL |
mysql.rand(integer) → numeric | 生成伪随机数。 | SQL |
round
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.round(integer) → integer | 按指定精度四舍五入。 | SQL |
mysql.round(integer, integer) → integer | 按指定精度四舍五入。 | SQL |
mysql.round(numeric) → integer | 按指定精度四舍五入。 | SQL |
mysql.round(numeric, integer) → numeric | 按指定精度四舍五入。 | SQL |
mysql.round(text) → numeric | 按指定精度四舍五入。 | SQL |
mysql.round(text, integer) → numeric | 按指定精度四舍五入。 | SQL |
sqrt
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.sqrt(bigint) → numeric | 计算平方根。 | SQL |
mysql.sqrt(integer) → numeric | 计算平方根。 | SQL |
mysql.sqrt(numeric) → numeric | 计算平方根。 | SQL |
mysql.sqrt(smallint) → numeric | 计算平方根。 | SQL |
truncate
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.truncate(numeric, integer) → numeric | 按指定小数位数截断数值。 | SQL |
2.2.5.3 - 日期时间函数
用于日期运算、格式化、解析、字段提取和读取时钟。
adddate
addtime
convert_tz
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.convert_tz(text, text, text) → timestamp without time zone | 在两个时区之间转换时间。 | SQL |
mysql.convert_tz(timestamp without time zone, text, text) → timestamp without time zone | 在两个时区之间转换时间。 | SQL |
curdate
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.curdate() → date | 返回当前日期。 | SQL |
curtime
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.curtime() → time without time zone | 返回当前时间。 | SQL |
mysql.curtime(prec integer) → time without time zone | 返回当前时间。 | SQL |
date
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.date(numeric) → date | 提取日期部分或将输入解析为日期。 | SQL |
pg_catalog.date(text) → date | 提取日期部分或将输入解析为日期。 | SQL |
date_add
date_format
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.date_format(text, text) → text | 用 MySQL 百分号格式符格式化日期。 | SQL |
mysql.date_format(timestamp with time zone, text) → text | 用 MySQL 百分号格式符格式化日期。 | SQL |
date_sub
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.date_sub(date, interval) → date | 从日期中减去天数或时间间隔。 | SQL |
mysql.date_sub(numeric, interval) → timestamp without time zone | 从日期中减去天数或时间间隔。 | SQL |
mysql.date_sub(text, interval) → timestamp without time zone | 从日期中减去天数或时间间隔。 | SQL |
mysql.date_sub(timestamp without time zone, interval) → timestamp without time zone | 从日期中减去天数或时间间隔。 | SQL |
datediff
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.datediff(date, date) → integer | 计算两个日期相差的天数。 | SQL |
mysql.datediff(numeric, numeric) → integer | 计算两个日期相差的天数。 | SQL |
mysql.datediff(numeric, text) → integer | 计算两个日期相差的天数。 | SQL |
mysql.datediff(text, numeric) → integer | 计算两个日期相差的天数。 | SQL |
mysql.datediff(text, text) → integer | 计算两个日期相差的天数。 | SQL |
mysql.datediff(text, timestamp without time zone) → integer | 计算两个日期相差的天数。 | SQL |
mysql.datediff(timestamp without time zone, text) → integer | 计算两个日期相差的天数。 | SQL |
mysql.datediff(timestamp without time zone, timestamp without time zone) → integer | 计算两个日期相差的天数。 | SQL |
day
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.day(numeric) → integer | 返回当月第几日。 | SQL |
mysql.day(text) → integer | 返回当月第几日。 | SQL |
mysql.day(timestamp without time zone) → integer | 返回当月第几日。 | SQL |
dayname
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.dayname(numeric) → text | 返回星期名称。 | SQL |
mysql.dayname(text) → text | 返回星期名称。 | SQL |
mysql.dayname(timestamp without time zone) → text | 返回星期名称。 | SQL |
dayofmonth
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.dayofmonth(numeric) → integer | 返回当月第几日。 | SQL |
mysql.dayofmonth(text) → integer | 返回当月第几日。 | SQL |
mysql.dayofmonth(timestamp without time zone) → integer | 返回当月第几日。 | SQL |
dayofweek
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.dayofweek(numeric) → integer | 返回星期编号,周日为 1。 | SQL |
mysql.dayofweek(text) → integer | 返回星期编号,周日为 1。 | SQL |
mysql.dayofweek(timestamp without time zone) → integer | 返回星期编号,周日为 1。 | SQL |
dayofyear
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.dayofyear(numeric) → integer | 返回当年的第几天。 | SQL |
mysql.dayofyear(text) → integer | 返回当年的第几天。 | SQL |
mysql.dayofyear(timestamp without time zone) → integer | 返回当年的第几天。 | SQL |
extract
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."extract"(text, text) → numeric | 提取指定的日期或时间字段。 | SQL |
mysql."extract"(text, time without time zone) → numeric | 提取指定的日期或时间字段。 | SQL · C |
mysql."extract"(text, timestamp without time zone) → numeric | 提取指定的日期或时间字段。 | SQL · C |
from_days
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.from_days(integer) → date | 将 MySQL 日序号转换为日期。 | SQL |
from_unixtime
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.from_unixtime(double precision) → timestamp without time zone | 将 Unix 时间转换为日期时间值或格式化字符串。 | SQL |
mysql.from_unixtime(double precision, text) → text | 将 Unix 时间转换为日期时间值或格式化字符串。 | SQL |
hour
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.hour(text) → integer | 提取小时。 | SQL |
mysql.hour(time without time zone) → integer | 提取小时。 | SQL |
mysql.hour(timestamp without time zone) → integer | 提取小时。 | SQL |
last_day
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.last_day(date) → date | 返回当月最后一天。 | SQL |
mysql.last_day(numeric) → date | 返回当月最后一天。 | SQL |
mysql.last_day(text) → date | 返回当月最后一天。 | SQL |
mysql.last_day(timestamp with time zone) → date | 返回当月最后一天。 | SQL |
mysql.last_day(timestamp without time zone) → date | 返回当月最后一天。 | SQL |
makedate
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.makedate(integer, integer) → date | 按年份和年内日序号生成日期。 | SQL |
maketime
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.maketime(integer, integer, numeric) → time without time zone | 用时、分、秒生成时间值。 | SQL |
microsecond
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.microsecond(text) → integer | 提取微秒。 | SQL |
mysql.microsecond(time without time zone) → integer | 提取微秒。 | SQL |
mysql.microsecond(timestamp without time zone) → integer | 提取微秒。 | SQL |
minute
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.minute(text) → integer | 提取分钟。 | SQL |
mysql.minute(time without time zone) → integer | 提取分钟。 | SQL |
mysql.minute(timestamp without time zone) → integer | 提取分钟。 | SQL |
month
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.month(numeric) → integer | 返回月份编号。 | SQL |
mysql.month(text) → integer | 返回月份编号。 | SQL |
mysql.month(timestamp without time zone) → integer | 返回月份编号。 | SQL |
monthname
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.monthname(numeric) → text | 返回月份名称。 | SQL |
mysql.monthname(text) → text | 返回月份名称。 | SQL |
mysql.monthname(timestamp without time zone) → text | 返回月份名称。 | SQL |
now
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.now() → timestamp without time zone | 返回当前事务的时间戳。 | SQL |
mysql.now(prec integer) → timestamp without time zone | 返回当前事务的时间戳。 | SQL |
period_add
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.period_add(integer, integer) → text | 给年月值加上指定月数。 | SQL |
period_diff
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.period_diff(integer, integer) → integer | 按月计算两个年月值之差。 | SQL |
quarter
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.quarter(date) → integer | 返回季度编号。 | SQL |
mysql.quarter(numeric) → integer | 返回季度编号。 | SQL |
mysql.quarter(text) → integer | 返回季度编号。 | SQL |
mysql.quarter(timestamp without time zone) → integer | 返回季度编号。 | SQL |
sec_to_time
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.sec_to_time(bigint) → time without time zone | 将秒数转换为时间值。 | SQL |
second
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.second(text) → integer | 提取秒数。 | SQL |
mysql.second(time without time zone) → integer | 提取秒数。 | SQL |
mysql.second(timestamp without time zone) → integer | 提取秒数。 | SQL |
str_to_date
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.str_to_date(text, text) → timestamp without time zone | 按 MySQL 格式串解析日期或时间。 | SQL |
subdate
subtime
sysdate
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.sysdate() → timestamp without time zone | 返回函数执行时的时钟时间。 | SQL |
mysql.sysdate(prec integer) → timestamp without time zone | 返回函数执行时的时钟时间。 | SQL |
time_format
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.time_format(time without time zone, text) → text | 格式化时间值。 | SQL |
time_to_sec
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.time_to_sec(text) → bigint | 将时间值换算为秒数。 | SQL |
mysql.time_to_sec(time without time zone) → bigint | 将时间值换算为秒数。 | SQL |
mysql.time_to_sec(timestamp without time zone) → bigint | 将时间值换算为秒数。 | SQL |
timediff
timestamp
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."timestamp"(text, text) → timestamp without time zone | 根据输入的日期和时间构造时间戳。 | SQL |
timestampadd
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.timestampadd(text, integer, timestamp without time zone) → timestamp without time zone | 按指定时间单位增加给定数量。 | SQL |
timestampdiff
to_days
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.to_days(date) → integer | 将日期换算为 MySQL 日序号。 | SQL |
mysql.to_days(text) → integer | 将日期换算为 MySQL 日序号。 | SQL |
mysql.to_days(timestamp without time zone) → integer | 将日期换算为 MySQL 日序号。 | SQL |
unix_timestamp
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.unix_timestamp() → bigint | 返回自 Unix 纪元起的秒数。 | SQL |
mysql.unix_timestamp(numeric) → numeric | 返回自 Unix 纪元起的秒数。 | SQL |
mysql.unix_timestamp(text) → numeric | 返回自 Unix 纪元起的秒数。 | SQL |
mysql.unix_timestamp(timestamp without time zone) → numeric | 返回自 Unix 纪元起的秒数。 | SQL |
utc_date
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.utc_date() → date | 返回 UTC 当前日期。 | SQL |
utc_time
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.utc_time() → time without time zone | 返回 UTC 当前时间。 | SQL |
mysql.utc_time(prec integer) → time without time zone | 返回 UTC 当前时间。 | SQL |
utc_timestamp
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.utc_timestamp() → timestamp without time zone | 返回当前 UTC 时间戳。 | SQL |
mysql.utc_timestamp(prec integer) → timestamp without time zone | 返回当前 UTC 时间戳。 | SQL |
week
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.week(numeric) → integer | 按周编号模式返回周数。 | SQL |
mysql.week(numeric, integer) → integer | 按周编号模式返回周数。 | SQL |
mysql.week(text) → integer | 按周编号模式返回周数。 | SQL |
mysql.week(text, integer) → integer | 按周编号模式返回周数。 | SQL |
mysql.week(timestamp without time zone) → integer | 按周编号模式返回周数。 | SQL |
mysql.week(timestamp without time zone, integer) → integer | 按周编号模式返回周数。 | SQL |
weekday
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.weekday(numeric) → integer | 返回星期编号,周一为 0。 | SQL |
mysql.weekday(text) → integer | 返回星期编号,周一为 0。 | SQL |
mysql.weekday(timestamp without time zone) → integer | 返回星期编号,周一为 0。 | SQL |
weekofyear
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.weekofyear(numeric) → integer | 返回当年的第几周。 | SQL |
mysql.weekofyear(text) → integer | 返回当年的第几周。 | SQL |
mysql.weekofyear(timestamp without time zone) → integer | 返回当年的第几周。 | SQL |
year
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.year(date) → integer | 提取年份。 | SQL |
mysql.year(numeric) → integer | 提取年份。 | SQL |
mysql.year(text) → integer | 提取年份。 | SQL |
mysql.year(timestamp without time zone) → integer | 提取年份。 | SQL |
yearweek
2.2.5.4 - 条件函数
查找 IF、IFNULL 和 ISNULL 时,同时核对条件和各分支的类型。
if
ifnull
isnull
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."isnull"(bigint) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(boolean) → boolean | 判断值是否为 NULL。 | SQL |
mysql."isnull"(mysql."real") → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(mysql."smallint") → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(smallint) → boolean | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val character varying) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val character) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val date) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val integer) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val json) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val numeric) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val text) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val time without time zone) → integer | 判断值是否为 NULL。 | SQL |
mysql."isnull"(val timestamp without time zone) → integer | 判断值是否为 NULL。 | SQL |
2.2.5.5 - 会话函数
查询连接身份、当前数据库、命名锁及语句状态。
connection_id
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.connection_id() → bigint | 返回本连接的 PostgreSQL 后端进程号。 | SQL |
current_user
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."current_user"() → text | 将当前有效 PostgreSQL 角色显示为 role@%。 | SQL · C |
database
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.database() → text | 返回本会话选中的 MySQL 数据库。 | SQL · C |
found_rows
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.found_rows() → bigint | 读取本会话记录的匹配行数。 | SQL · C |
get_lock
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_lock("any", "any") → bigint | 在超时时限内获取指定名称的会话锁。 | SQL · C |
is_free_lock
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.is_free_lock("any") → bigint | 检查指定名称的锁是否空闲。 | SQL · C |
is_used_lock
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.is_used_lock("any") → bigint | 查询指定名称的锁由哪个连接持有。 | SQL · C |
last_insert_id
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.last_insert_id() → bigint | 读取本会话最近生成的插入 ID。 | SQL · C |
release_all_locks
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.release_all_locks() → bigint | 释放本会话持有的所有命名锁。 | SQL · C |
release_lock
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.release_lock("any") → bigint | 释放指定名称的会话锁。 | SQL · C |
row_count
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.row_count() → bigint | 读取上一条语句影响的行数。 | SQL · C |
schema
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.schema() → text | 返回本会话选中的 MySQL 数据库。 | SQL · C |
session_user
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."session_user"() → text | 返回会话角色和客户端主机名。 | SQL · C |
sleep
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.sleep(seconds numeric) → character varying | 等待指定的秒数。 | SQL |
user
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."user"() → text | 以文本返回 PostgreSQL 的 current_user。 | SQL |
uuid
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.uuid() → text | 生成 UUID。 | SQL |
uuid_short
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.uuid_short() → text | 生成 MySQL 短格式标识符。 | SQL · C |
version
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.version() → text | 返回对 MySQL 客户端通告的服务器版本。 | SQL · C |
2.2.5.6 - 类型转换辅助函数
供 CAST、类型强制转换和表达式改写调用。
B
C
H
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.hexlit_bit(mysql.hexlit, integer, boolean) → bit | 将 mysql.hexlit 转为 bit。 | SQL · C |
mysql.hexlit_bool(mysql.hexlit) → boolean | 将 mysql.hexlit 转为 boolean。 | SQL · C |
mysql.hexlit_bpchar(mysql.hexlit) → character | 将 mysql.hexlit 转为 character。 | SQL · C |
mysql.hexlit_float4(mysql.hexlit) → real | 将 mysql.hexlit 转为 real。 | SQL |
mysql.hexlit_float8(mysql.hexlit) → double precision | 将 mysql.hexlit 转为 double precision。 | SQL |
mysql.hexlit_int2(mysql.hexlit) → smallint | 将 mysql.hexlit 转为 smallint。 | SQL |
mysql.hexlit_int4(mysql.hexlit) → integer | 将 mysql.hexlit 转为 integer。 | SQL |
mysql.hexlit_int8(mysql.hexlit) → bigint | 将 mysql.hexlit 转为 bigint。 | SQL · C |
mysql.hexlit_numeric(mysql.hexlit) → numeric | 将 mysql.hexlit 转为 numeric。 | SQL · C |
mysql.hexlit_text(mysql.hexlit) → text | 将 mysql.hexlit 转为 text。 | SQL · C |
mysql.hexlit_varbit(mysql.hexlit, integer, boolean) → bit varying | 将 mysql.hexlit 转为 bit varying。 | SQL · C |
mysql.hexlit_varchar(mysql.hexlit) → character varying | 将 mysql.hexlit 转为 character varying。 | SQL · C |
I
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql."interval"(text, integer) → interval | 将 text 转为 interval。 | SQL · C |
S
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.str_to_double(text) → double precision | 将字符串解析为浮点数。 | SQL |
T
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.time_to_timestamp(time without time zone) → timestamp without time zone | 将 time without time zone 转为 timestamp without time zone。 | SQL |
V
2.2.5.7 - 比较运算符实现
等值和顺序比较运算符使用的内部入口。
A
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.anycompatibleeqbytea(anycompatible, bytea) → boolean | 实现 = 运算(等于)。 | SQL · C |
mysql.anycompatiblegebytea(anycompatible, bytea) → boolean | 实现 >= 运算(大于或等于)。 | SQL · C |
mysql.anycompatiblegtbytea(anycompatible, bytea) → boolean | 实现 > 运算(大于)。 | SQL · C |
mysql.anycompatiblelebytea(anycompatible, bytea) → boolean | 实现 <= 运算(小于或等于)。 | SQL · C |
mysql.anycompatibleltbytea(anycompatible, bytea) → boolean | 实现 < 运算(小于)。 | SQL · C |
mysql.anycompatiblenebytea(anycompatible, bytea) → boolean | 实现 <> 运算(不等于)。 | SQL · C |
B
C
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.char_eq_char_for_date_format(character, character) → boolean | 实现 =# 运算(比较日期格式符字符)。 | SQL · C |
D
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.date_eq_text(date, text) → boolean | 实现 = 运算(等于)。 | SQL |
mysql.date_ge_text(date, text) → boolean | 实现 >= 运算(大于或等于)。 | SQL |
mysql.date_gt_text(date, text) → boolean | 实现 > 运算(大于)。 | SQL |
mysql.date_le_text(date, text) → boolean | 实现 <= 运算(小于或等于)。 | SQL |
mysql.date_lt_text(date, text) → boolean | 实现 < 运算(小于)。 | SQL |
mysql.date_ne_text(date, text) → boolean | 实现 <> 运算(不等于)。 | SQL |
mysql.dateeqtext(date, text) → boolean | 转换操作数后判断是否相等。 | SQL |
mysql.datenetext(date, text) → boolean | 转换操作数后判断是否不相等。 | SQL |
F
H
I
N
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.numeric_eq_hexlit(numeric, mysql.hexlit) → boolean | 实现 = 运算(等于)。 | 生成定义 |
mysql.numeric_ge_hexlit(numeric, mysql.hexlit) → boolean | 实现 >= 运算(大于或等于)。 | 生成定义 |
mysql.numeric_gt_hexlit(numeric, mysql.hexlit) → boolean | 实现 > 运算(大于)。 | 生成定义 |
mysql.numeric_le_hexlit(numeric, mysql.hexlit) → boolean | 实现 <= 运算(小于或等于)。 | 生成定义 |
mysql.numeric_lt_hexlit(numeric, mysql.hexlit) → boolean | 实现 < 运算(小于)。 | 生成定义 |
mysql.numeric_ne_hexlit(numeric, mysql.hexlit) → boolean | 实现 <> 运算(不等于)。 | 生成定义 |
mysql.numeric_nseq_hexlit(numeric, mysql.hexlit) → boolean | 实现 <=> 运算(NULL 安全等值比较)。 | 生成定义 |
mysql.numericbgeqtext(numeric, text) → boolean | 实现 >= 运算(大于或等于)。 | SQL |
mysql.numericbgtext(numeric, text) → boolean | 实现 > 运算(大于)。 | SQL |
mysql.numericeqtext(numeric, text) → boolean | 实现 = 运算(等于)。 | SQL |
mysql.numericleeqtext(numeric, text) → boolean | 实现 <= 运算(小于或等于)。 | SQL |
mysql.numericletext(numeric, text) → boolean | 实现 < 运算(小于)。 | SQL |
mysql.numericnetext(numeric, text) → boolean | 实现 <> 运算(不等于)。 | SQL |
S
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.smallintbgeqtext(mysql."smallint", text) → boolean | 实现 >= 运算(大于或等于)。 | SQL |
mysql.smallintbgtext(mysql."smallint", text) → boolean | 实现 > 运算(大于)。 | SQL |
mysql.smallintleeqtext(mysql."smallint", text) → boolean | 实现 <= 运算(小于或等于)。 | SQL |
mysql.smallintletext(mysql."smallint", text) → boolean | 实现 < 运算(小于)。 | SQL |
T
V
2.2.5.8 - 算术运算符实现
供不同类型的 MySQL 操作数做算术运算。
_
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql._add_bool(boolean) → smallint | 实现 + 运算(一元正号)。 | SQL |
mysql._add_null(text) → smallint | 实现 + 运算(一元正号)。 | SQL |
mysql._sub_bool(boolean) → smallint | 实现 - 运算(一元负号)。 | SQL |
mysql._sub_null(text) → smallint | 实现 - 运算(一元负号)。 | SQL |
A
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.anycompatibledivbytea(anycompatible, bytea) → numeric | 实现 / 运算(相除)。 | SQL · C |
mysql.anycompatiblemibytea(anycompatible, bytea) → numeric | 实现 - 运算(相减)。 | SQL · C |
mysql.anycompatiblemodbytea(anycompatible, bytea) → numeric | 实现 % 运算(取余)。 | SQL · C |
mysql.anycompatiblemulbytea(anycompatible, bytea) → numeric | 实现 * 运算(相乘)。 | SQL · C |
mysql.anycompatibleplbytea(anycompatible, bytea) → numeric | 实现 + 运算(相加)。 | SQL · C |
B
C
D
F
H
I
M
N
T
V
2.2.5.9 - 位运算与逻辑运算符实现
供位运算和逻辑判断调用。
A
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.anycompatibleandbytea(anycompatible, bytea) → bigint | 实现 & 运算(按位与)。 | SQL · C |
mysql.anycompatiblecondandbytea(anycompatible, bytea) → boolean | 实现 && 运算(逻辑与)。 | SQL · C |
mysql.anycompatiblecondorbytea(anycompatible, bytea) → boolean | 实现 || 运算(逻辑或)。 | SQL · C |
mysql.anycompatiblenonarray_or_text(anycompatiblenonarray, text) → boolean | 实现 || 运算(逻辑或)。 | SQL |
mysql.anycompatibleorbytea(anycompatible, bytea) → bigint | 实现 | 运算(按位或)。 | SQL · C |
mysql.anynonarray_or_text(anynonarray, text) → boolean | 转换操作数后计算逻辑或。 | SQL |
B
F
H
I
N
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.numeric_and_hexlit(numeric, mysql.hexlit) → bigint | 实现 & 运算(按位与)。 | 生成定义 |
mysql.numeric_or_hexlit(numeric, mysql.hexlit) → bigint | 实现 | 运算(按位或)。 | 生成定义 |
mysql.numeric_shl_hexlit(numeric, mysql.hexlit) → bigint | 实现 << 运算(左移)。 | 生成定义 |
mysql.numeric_shr_hexlit(numeric, mysql.hexlit) → bigint | 实现 >> 运算(右移)。 | 生成定义 |
mysql.numeric_xor_hexlit(numeric, mysql.hexlit) → bigint | 实现 ^# 运算(按位异或)。 | 生成定义 |
mysql.numericandint2(numeric, smallint) → bigint | 实现 & 运算(按位与)。 | SQL |
mysql.numericandint4(numeric, integer) → bigint | 实现 & 运算(按位与)。 | SQL |
mysql.numericandint8(numeric, bigint) → bigint | 实现 & 运算(按位与)。 | SQL |
mysql.numericorint2(numeric, smallint) → bigint | 实现 | 运算(按位或)。 | SQL |
mysql.numericorint4(numeric, integer) → bigint | 实现 | 运算(按位或)。 | SQL |
mysql.numericorint8(numeric, bigint) → bigint | 实现 | 运算(按位或)。 | SQL |
T
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.text_and_hexlit(text, mysql.hexlit) → bigint | 实现 & 运算(按位与)。 | 生成定义 |
mysql.text_and_text(text, text) → boolean | 实现 && 运算(逻辑与)。 | SQL |
mysql.text_or_anycompatiblenonarray(text, anycompatiblenonarray) → boolean | 实现 || 运算(逻辑或)。 | SQL |
mysql.text_or_anynoarray(text, anynonarray) → boolean | 转换操作数后计算逻辑或。 | SQL |
mysql.text_or_hexlit(text, mysql.hexlit) → bigint | 实现 | 运算(按位或)。 | 生成定义 |
mysql.text_or_text(text, text) → boolean | 实现 || 运算(逻辑或)。 | SQL |
mysql.text_shl_hexlit(text, mysql.hexlit) → bigint | 实现 << 运算(左移)。 | 生成定义 |
mysql.text_shr_hexlit(text, mysql.hexlit) → bigint | 实现 >> 运算(右移)。 | 生成定义 |
mysql.text_xor_hexlit(text, mysql.hexlit) → bigint | 实现 ^# 运算(按位异或)。 | 生成定义 |
V
2.2.5.10 - 模式匹配与 JSON 运算符实现
供 LIKE、正则表达式及 JSON 字段访问调用。
A
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.anycompatiblelikebytea(anycompatible, bytea) → boolean | 实现 ~~ 运算(LIKE 模式匹配)。 | SQL · C |
mysql.anycompatiblenlikebytea(anycompatible, bytea) → boolean | 实现 !~~ 运算(LIKE 取反匹配)。 | SQL · C |
mysql.anycompatiblenregexpbinbytea(anycompatible, bytea) → boolean | 实现 !~ 运算(区分大小写的正则取反匹配)。 | SQL · C |
mysql.anycompatiblenregexpbytea(anycompatible, bytea) → boolean | 实现 !~* 运算(忽略大小写的正则取反匹配)。 | SQL · C |
mysql.anycompatibleregexpbinbytea(anycompatible, bytea) → boolean | 实现 ~ 运算(区分大小写的正则匹配)。 | SQL · C |
mysql.anycompatibleregexpbytea(anycompatible, bytea) → boolean | 实现 ~* 运算(忽略大小写的正则匹配)。 | SQL · C |
B
H
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.hexlit_like(mysql.hexlit, mysql.hexlit) → boolean | 实现 ~~ 运算(LIKE 模式匹配)。 | 生成定义 |
mysql.hexlit_like_bytea(mysql.hexlit, bytea) → boolean | 实现 ~~ 运算(LIKE 模式匹配)。 | 生成定义 |
mysql.hexlit_like_text(mysql.hexlit, text) → boolean | 实现 ~~ 运算(LIKE 模式匹配)。 | 生成定义 |
mysql.hexlit_nlike(mysql.hexlit, mysql.hexlit) → boolean | 实现 !~~ 运算(LIKE 取反匹配)。 | 生成定义 |
mysql.hexlit_nlike_bytea(mysql.hexlit, bytea) → boolean | 实现 !~~ 运算(LIKE 取反匹配)。 | 生成定义 |
mysql.hexlit_nlike_text(mysql.hexlit, text) → boolean | 实现 !~~ 运算(LIKE 取反匹配)。 | 生成定义 |
J
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.json_object_field(from_json json, field_name text) → json | 实现 -> 运算(按名称提取 JSON 字段)。 | SQL |
P
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.prefix_like(character, text) → boolean | 实现 | SQL · C |
mysql.prefix_like(text, text) → boolean | 实现 | SQL · C |
mysql.prefix_not_like(character, text) → boolean | 实现 ! | SQL · C |
mysql.prefix_not_like(text, text) → boolean | 实现 ! | SQL · C |
R
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.regular_expr(bigint, text) → boolean | 实现 ~* 运算(忽略大小写的正则匹配)。 | SQL |
mysql.regular_expr_not(bigint, text) → boolean | 实现 !~* 运算(忽略大小写的正则取反匹配)。 | SQL |
T
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.text_like_bigint(text, bigint) → boolean | 实现 ~~ 运算(LIKE 模式匹配)。 | SQL |
mysql.text_like_hexlit(text, mysql.hexlit) → boolean | 实现 ~~ 运算(LIKE 模式匹配)。 | 生成定义 |
mysql.text_nlike_hexlit(text, mysql.hexlit) → boolean | 实现 !~~ 运算(LIKE 取反匹配)。 | 生成定义 |
mysql.text_not_like_bigint(text, bigint) → boolean | 实现 !~~ 运算(LIKE 取反匹配)。 | SQL |
2.2.5.11 - 字符串与数值辅助函数
供子串查找、格式校验和取整使用。
C
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.ceil_for_mysql(text) → bigint | 解析文本并向上取整。 | SQL · C |
mysql.check_set(text, text) → boolean | 按 SET 定义校验输入值。 | SQL · C |
F
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.floor_for_mysql(text) → bigint | 解析文本并向下取整。 | SQL · C |
I
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.is_numeric(text) → boolean | 校验输入是否符合相应的数值格式。 | SQL |
mysql.is_valid_binary(text) → boolean | 校验输入是否符合相应的数值格式。 | SQL · C |
mysql.is_valid_hex(text) → boolean | 校验输入是否符合相应的数值格式。 | SQL · C |
T
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.text_instr(text, text) → integer | 为 LOCATE 或 INSTR 查找子串位置。 | SQL · C |
mysql.text_locate2(text, text) → integer | 为 LOCATE 或 INSTR 查找子串位置。 | SQL · C |
mysql.text_locate3(text, text, bigint) → integer | 为 LOCATE 或 INSTR 查找子串位置。 | SQL · C |
2.2.5.12 - 日期时间辅助函数
供日期规格化、周编号和数值日期运算使用。
_
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql._calc_days_in_year(integer) → integer | 计算指定年份的天数。 | SQL |
mysql._calc_week(qdate date, behavior integer) → integer[] | 按 MySQL 的周编号规则计算星期或周数。 | SQL |
mysql._calc_weekday(qdate date, sundayfirst boolean) → integer | 按 MySQL 的周编号规则计算星期或周数。 | SQL |
mysql._convert_format_to_halo_for_number_datetime(text) → text | 整理日期时间输入,供后续转换为 text。 | SQL |
mysql._convert_format_to_halo_for_string_datetime(text) → text | 整理日期时间输入,供后续转换为 text。 | SQL |
mysql._convert_format_to_halo_for_string_number_datetime(text) → text | 整理日期时间输入,供后续转换为 text。 | SQL |
mysql._convert_format_to_halo_for_string_string_datetime(text) → text | 整理日期时间输入,供后续转换为 text。 | SQL |
mysql._date_padding(text) → text | 整理日期时间输入,供后续转换为 text。 | SQL |
mysql._process_for_number_datetime(text) → text | 整理日期时间输入,供后续转换为 text。 | SQL |
mysql._process_for_string_number_datetime(text) → text | 整理日期时间输入,供后续转换为 text。 | SQL |
mysql._week_mode(mode integer) → integer | 按 MySQL 的周编号规则计算星期或周数。 | SQL |
C
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.convert_to_time_format(text) → interval | 整理日期时间输入,供后续转换为 interval。 | SQL |
mysql.curdate_add(integer) → integer | 对当天的 YYYYMMDD 整数值做加减运算。 | SQL |
mysql.curdate_sub(integer) → integer | 对当天的 YYYYMMDD 整数值做加减运算。 | SQL |
N
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.numeric_timestamp(numeric) → timestamp without time zone | 整理日期时间输入,供后续转换为 timestamp without time zone。 | SQL |
r4 中的函数名
安装快照 (0d51adc) | r4 源码 (1e631f9) |
|---|---|
mysql._convert_format_to_halo_for_number_datetime | mysql._normalize_numeric_datetime |
mysql._convert_format_to_halo_for_string_datetime | mysql._normalize_datetime_text |
mysql._convert_format_to_halo_for_string_number_datetime | mysql._normalize_compact_datetime_text |
mysql._convert_format_to_halo_for_string_string_datetime | mysql._normalize_delimited_datetime_text |
2.2.5.13 - 二进制与字符串存储辅助函数
供类型输入输出、二进制表达式求值和字符串结果转换使用。
A
B
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.binary_n_in(cstring, oid, integer) → mysql.binary_n | 读入二进制值的文本表示。 | 生成定义 · C |
mysql.binary_n_out(mysql.binary_n) → cstring | 输出二进制值的文本表示。 | 生成定义 |
mysql.binary_n_recv(internal, oid, integer) → mysql.binary_n | 接收 PostgreSQL 二进制格式。 | 生成定义 · C |
mysql.binary_n_send(mysql.binary_n) → bytea | 发送 PostgreSQL 二进制格式。 | 生成定义 |
mysql.binary_n_typmodin(cstring[]) → integer | 解析声明的长度修饰符。 | 生成定义 · C |
mysql.binary_n_typmodout(integer) → cstring | 格式化长度修饰符。 | 生成定义 · C |
mysql.binary_truth("any") → boolean | 计算二进制或字符串操作数的真假值。 | SQL · C |
C
E
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.elt_index("any") → integer | 将 ELT 的选择参数转换成位置。 | SQL · C |
H
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.hexlit_cmp_support(internal) → internal | 为十六进制字面量比较提供规划器支持。 | SQL · C |
mysql.hexlit_in(cstring) → mysql.hexlit | 读入二进制值的文本表示。 | SQL |
mysql.hexlit_out(mysql.hexlit) → cstring | 输出二进制值的文本表示。 | SQL |
mysql.hexlit_recv(internal) → mysql.hexlit | 接收 PostgreSQL 二进制格式。 | SQL |
mysql.hexlit_send(mysql.hexlit) → bytea | 发送 PostgreSQL 二进制格式。 | SQL |
M
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.mys_uint64_bitnot(numeric) → numeric | 按 MySQL 无符号 64 位规则计算位运算。 | SQL · C |
mysql.mys_uint64_bitop(numeric, numeric, "char") → bigint | 按 MySQL 无符号 64 位规则计算位运算。 | SQL · C |
R
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.raw_bytes("any") → bytea | 提取输入值的原始字节。 | SQL · C |
S
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.string_result(anyelement, "any") → anyelement | 生成改写表达式的字符串结果。 | SQL · C |
V
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.varbinary_n_in(cstring, oid, integer) → mysql.varbinary_n | 读入二进制值的文本表示。 | 生成定义 · C |
mysql.varbinary_n_out(mysql.varbinary_n) → cstring | 输出二进制值的文本表示。 | 生成定义 |
mysql.varbinary_n_recv(internal, oid, integer) → mysql.varbinary_n | 接收 PostgreSQL 二进制格式。 | 生成定义 · C |
mysql.varbinary_n_send(mysql.varbinary_n) → bytea | 发送 PostgreSQL 二进制格式。 | 生成定义 |
mysql.varbinary_n_typmodin(cstring[]) → integer | 解析声明的长度修饰符。 | 生成定义 · C |
mysql.varbinary_n_typmodout(integer) → cstring | 格式化长度修饰符。 | 生成定义 · C |
2.2.5.14 - 聚合支持函数
聚合执行时调用的内部状态转移函数和最终函数。
B
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.bit_and_varbit(bigint, bit varying) → bigint | 将本行输入合并到聚合状态。 | SQL |
mysql.bit_and_varbit_final(bigint) → bigint | 根据聚合状态生成结果。 | SQL |
mysql.bit_or_varbit(bigint, bit varying) → bigint | 将本行输入合并到聚合状态。 | SQL |
mysql.bit_or_varbit_final(bigint) → bigint | 根据聚合状态生成结果。 | SQL |
mysql.bit_xor_varbit(bigint, bit varying) → bigint | 将本行输入合并到聚合状态。 | SQL |
mysql.bit_xor_varbit_final(bigint) → bigint | 根据聚合状态生成结果。 | SQL |
D
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.dummy_min_finalfunc_for_bytea(bytea) → bytea | 根据聚合状态生成结果。 | SQL |
mysql.dummy_min_sfunc_for_bytea(bytea, bytea) → bytea | 将本行输入合并到聚合状态。 | SQL |
S
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.sum_bool(bigint, boolean) → bigint | 将本行输入合并到聚合状态。 | SQL |
mysql.sum_text(numeric, text) → numeric | 将本行输入合并到聚合状态。 | SQL |
mysql.sum_text_final(numeric) → numeric | 根据聚合状态生成结果。 | SQL |
T
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.text_avg_accum(internal, text) → internal | 将本行输入合并到聚合状态。 | SQL · C |
2.2.5.15 - 索引支持函数
供索引访问、键比较、哈希和运算符类注册使用。
B
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.binary_n_cmp(mysql.binary_n, mysql.binary_n) → integer | 按 B-tree 顺序比较二进制键。 | 生成定义 |
mysql.binary_n_cmp_bytea(mysql.binary_n, bytea) → integer | 按 B-tree 顺序比较二进制键。 | 生成定义 |
mysql.binary_n_cmp_varbinary_n(mysql.binary_n, mysql.varbinary_n) → integer | 按 B-tree 顺序比较二进制键。 | 生成定义 |
mysql.binary_n_hash(mysql.binary_n) → integer | 为哈希索引计算二进制键的哈希值。 | 生成定义 |
mysql.binary_n_hash_extended(mysql.binary_n, bigint) → bigint | 为哈希索引计算二进制键的哈希值。 | 生成定义 |
mysql.bytea_cmp_binary_n(bytea, mysql.binary_n) → integer | 按 B-tree 顺序比较二进制键。 | 生成定义 |
mysql.bytea_cmp_varbinary_n(bytea, mysql.varbinary_n) → integer | 按 B-tree 顺序比较二进制键。 | 生成定义 |
H
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.hexlit_cmp(mysql.hexlit, mysql.hexlit) → integer | 按 B-tree 顺序比较二进制键。 | SQL |
mysql.hexlit_hash(mysql.hexlit) → integer | 为哈希索引计算二进制键的哈希值。 | SQL |
mysql.hexlit_hash_extended(mysql.hexlit, bigint) → bigint | 为哈希索引计算二进制键的哈希值。 | SQL |
P
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.prefix_1042_cmp(character, character) → integer | 为 mysql_prefix 索引比较两个键值。 | 生成定义 · C |
mysql.prefix_17_cmp(bytea, bytea) → integer | 为 mysql_prefix 索引比较两个键值。 | 生成定义 · C |
mysql.prefix_25_cmp(text, text) → integer | 为 mysql_prefix 索引比较两个键值。 | 生成定义 · C |
mysql.prefix_53875699983efc79eeb9e023e66605f5_cmp(mysql.binary_n, mysql.binary_n) → integer | 为 mysql_prefix 索引比较两个键值。 | 生成定义 · C |
mysql.prefix_b8aba7e65857eaf6a91ca737fb14b87b_cmp(mysql.varbinary_n, mysql.varbinary_n) → integer | 为 mysql_prefix 索引比较两个键值。 | 生成定义 · C |
mysql.prefix_handler(internal) → index_am_handler | 提供 mysql_prefix 访问方法的回调。 | SQL · C |
mysql.prefix_options(internal) → void | 声明前缀键运算符类的选项。 | SQL · C |
R
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.register_prefix_binary(t regtype) → void | 为指定类型注册前缀索引支持,需要执行权限。 | SQL |
mysql.register_prefix_type(t regtype, string_storage boolean) → void | 为指定类型注册前缀索引支持,需要执行权限。 | SQL |
V
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.varbinary_n_cmp(mysql.varbinary_n, mysql.varbinary_n) → integer | 按 B-tree 顺序比较二进制键。 | 生成定义 |
mysql.varbinary_n_cmp_binary_n(mysql.varbinary_n, mysql.binary_n) → integer | 按 B-tree 顺序比较二进制键。 | 生成定义 |
mysql.varbinary_n_cmp_bytea(mysql.varbinary_n, bytea) → integer | 按 B-tree 顺序比较二进制键。 | 生成定义 |
mysql.varbinary_n_hash(mysql.varbinary_n) → integer | 为哈希索引计算二进制键的哈希值。 | 生成定义 |
mysql.varbinary_n_hash_extended(mysql.varbinary_n, bigint) → bigint | 为哈希索引计算二进制键的哈希值。 | 生成定义 |
2.2.5.16 - 会话状态与变量辅助函数
供 SET、SHOW、用户变量与认证缓存管理使用。
C
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.clear_user_variables() → void | 清除本会话的用户变量。 | SQL · C |
F
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.flush_auth_cache() → bigint | 清空快速认证缓存,需要执行权限。 | SQL · C |
G
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_system_global_variable(text) → text | 读取全局 @@ 系统变量。 | SQL |
mysql.get_system_session_variable(text) → text | 读取会话级 @@ 系统变量。 | SQL |
mysql.get_system_variable(text, boolean) → text | 按指定作用域读取系统变量。 | SQL · C |
mysql.get_user_var(variable_name character varying) → bytea | 读取 MySQL @ 用户变量。 | SQL · C |
mysql.getenv(text) → text | 安装时读取服务器环境变量,需要执行权限。 | SQL · C |
S
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.set_system_charset_variable(text) → void | 处理当前连接的 SET CHARACTER SET。 | SQL · C |
mysql.set_system_global_variable(text, anycompatible) → void | 设置系统变量的全局值。 | SQL |
mysql.set_system_names_variable(text) → void | 处理当前连接的 SET NAMES。 | SQL · C |
mysql.set_system_names_variable(text, text) → void | 处理当前连接的 SET NAMES。 | SQL · C |
mysql.set_system_session_variable(text, anycompatible) → void | 设置系统变量的会话值。 | SQL |
mysql.set_system_variable(text, text, boolean) → boolean | 在指定作用域内给系统变量赋值。 | SQL · C |
mysql.set_user_var(variable_name character varying, variable_value anycompatible) → void | 为 SET 或表达式求值保存 MySQL @ 用户变量。 | SQL · C |
mysql.set_user_var_in_expr(variable_name character varying, variable_value anycompatible) → bytea | 为 SET 或表达式求值保存 MySQL @ 用户变量。 | SQL · C |
mysql.show_system_variable(text, boolean) → text | 按指定作用域读取系统变量。 | SQL · C |
2.2.5.17 - DDL 与写入辅助函数
供列表达式、序列和行触发器调用。
auto_increment_advance
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.auto_increment_advance() → trigger | 显式写入自增值后推进序列。 | SQL · C |
column_default
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.column_default(oid, integer) → text | 读取列的默认表达式。 | SQL · C |
generated_column
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.generated_column(text, anyelement) → anyelement | 在改写后的表达式中传递生成列的值。 | SQL |
generated_numeric
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.generated_numeric(numeric, integer) → numeric | 按声明的类型修饰符转换生成列的值。 | SQL · C |
generated_value
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.generated_value(anyelement) → anyelement | 在改写后的表达式中传递生成列的值。 | SQL |
generated_varchar
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.generated_varchar(text, integer, boolean) → text | 按声明的类型修饰符转换生成列的值。 | SQL · C |
lenient_float8
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.lenient_float8(text) → double precision | 为非严格模式下的写入转换列值。 | SQL · C |
lenient_int
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.lenient_int(text, bigint, bigint) → bigint | 为非严格模式下的写入转换列值。 | SQL · C |
lenient_numeric
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.lenient_numeric(text, integer) → numeric | 为非严格模式下的写入转换列值。 | SQL · C |
lenient_varchar
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.lenient_varchar(text, integer) → text | 为非严格模式下的写入转换列值。 | SQL · C |
on_update_current_timestamp
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.on_update_current_timestamp() → trigger | 通过行触发器更新带 ON UPDATE 的时间戳列。 | SQL · C |
part_list_columns
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.part_list_columns(VARIADIC "any") → text | 构造列表分区的列键。 | SQL · C |
pending_fk_definitions
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.pending_fk_definitions(oid) → SETOF text | 为子表生成待处理外键的定义文本。 | SQL |
pending_fk_guard
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.pending_fk_guard() → trigger | 执行待处理外键的触发器逻辑。 | SQL · C |
setval
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.setval(regclass, bigint, boolean) → bigint | 设置序列值及其已调用标志。 | SQL · C |
2.2.5.18 - SHOW 与元数据辅助函数
为 MySQL 客户端格式化目录值并构造结果集。
amend_def_val
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.amend_def_val(text) → text | 将 PostgreSQL 默认表达式格式化为 MySQL 元数据。 | SQL |
amend_def_val_for_internal
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.amend_def_val_for_internal(text) → text | 将 PostgreSQL 默认表达式格式化为 MySQL 元数据。 | SQL |
column_domain
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.column_domain(oid, integer) → oid | 查找列所声明的域。 | SQL |
column_extra
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.column_extra(oid, integer) → text | 构造列元数据中的 Extra 字段。 | SQL · C |
column_generation
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.column_generation(oid, integer) → text | 读取生成列的表达式。 | SQL · C |
decimal_column_type
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.decimal_column_type(integer) → text | 从类型修饰符解析 DECIMAL 的精度和标度。 | SQL · C |
decimal_ps
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.decimal_ps(integer) → integer[] | 从类型修饰符解析 DECIMAL 的精度和标度。 | SQL |
get_column_extra
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_column_extra(text) → text | 构造列元数据中的 Extra 字段。 | SQL |
get_column_key
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_column_key(oid, text) → text | 判断列属于哪类索引键。 | SQL |
mysql.get_column_key(text, text, text) → text | 判断列属于哪类索引键。 | SQL |
get_func_def
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_func_def(funcname text, procowner text, prorettype oid, proargtypes oidvector, proargnames text[], prosrc text) → text | 根据系统目录字段还原例程定义。 | SQL |
get_funcs_procs_parameters
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_funcs_procs_parameters() → SETOF record | 为元数据客户端列出例程参数。 | SQL |
get_mysql_proc_arg_mode
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_mysql_proc_arg_mode(text) → text | 将 PostgreSQL 参数模式转换为 MySQL 参数模式。 | SQL |
get_mysql_type_name
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_mysql_type_name(oid) → text | 将目录中的类型转换为 MySQL 显示名。 | SQL |
get_proc_def
get_seq_in_index
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.get_seq_in_index(text, int2vector) → smallint | 查找列在索引键中的序号。 | SQL |
index_key_name
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.index_key_name(oid) → text | 为 SHOW INDEX 提供索引名或索引键组成。 | SQL · C |
index_key_parts
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.index_key_parts(oid, OUT seq integer, OUT column_name text, OUT sub_part integer) → SETOF record | 为 SHOW INDEX 提供索引名或索引键组成。 | SQL · C |
show_create_function
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_create_function(text, text) → SETOF record | 构造 SHOW CREATE 展示的对象定义。 | SQL |
show_create_procedure
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_create_procedure(text, text) → SETOF record | 构造 SHOW CREATE 展示的对象定义。 | SQL |
show_create_table
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_create_table(text, text) → text | 构造 SHOW CREATE 展示的对象定义。 | SQL |
show_create_table_impl
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_create_table_impl(oid, oid, text, text) → text | 构造 SHOW CREATE 展示的对象定义。 | SQL |
show_create_trigger
show_create_view
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_create_view(text, text) → text | 构造 SHOW CREATE 展示的对象定义。 | SQL |
show_create_view_impl
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_create_view_impl(text, text) → text | 构造 SHOW CREATE 展示的对象定义。 | SQL · C |
show_diagnostics
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_diagnostics(boolean) → TABLE("Level" text, "Code" integer, "Message" text) | 返回 SHOW WARNINGS 或 SHOW ERRORS 使用的会话诊断记录。 | SQL · C |
show_table_columns
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_table_columns(text, text) → SETOF record | 生成 SHOW COLUMNS 的列信息。 | SQL |
show_table_full_columns
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_table_full_columns(text, text) → SETOF record | 生成 SHOW COLUMNS 的列信息。 | SQL |
show_table_indexs
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_table_indexs(text, text) → SETOF record | 生成 SHOW INDEX 的索引信息。 | SQL |
show_table_indexs_for_8
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.show_table_indexs_for_8(text, text) → SETOF record | 生成 SHOW INDEX 的索引信息。 | SQL |
2.2.6 - 聚合
按输入类型查找聚合,核对每组结果的返回类型。
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql.avg(text) → numeric | 对从文本读取的数值求平均。 | SQL |
mysql.bit_and(bit varying) → bigint | 对各行输入做按位与。 | SQL |
mysql.bit_or(bit varying) → bigint | 对各行输入做按位或。 | SQL |
mysql.bit_xor(bit varying) → bigint | 对各行输入做按位异或。 | SQL |
mysql.dummy_min_for_bytea(bytea) → bytea | 内部聚合,保留传给转移函数的输入值。 | SQL |
mysql.sum(boolean) → bigint | 累加转换后的输入值。 | SQL |
mysql.sum(text) → numeric | 累加转换后的输入值。 | SQL |
2.2.7 - 运算符
先匹配符号,再核对左右操作数类型。左侧为 NONE 表示一元前缀运算符。
符号取自 PostgreSQL 系统目录。例如,MySQL 的 LIKE 可解析为 ~~ 等模式匹配运算符。
算术
位运算与逻辑运算
比较
模式匹配与 JSON
2.2.8 - 元数据视图
在 MySQL 方言中使用 MySQL 名称,在 psql 中使用 PostgreSQL 名称。用途栏注明 SHOW 和待处理外键所用的视图。
mys_informa_schema
| PostgreSQL 对象 | MySQL 名称 | 用途 | 源码定义 |
|---|---|---|---|
mys_informa_schema.columns | information_schema.columns | 列序、类型、默认值、键和生成表达式。 | SQL |
mys_informa_schema.empty_global_variables | information_schema.empty_global_variables | 供 SHOW GLOBAL VARIABLES 读取的全局系统变量名和值。 | SQL |
mys_informa_schema.empty_session_variables | information_schema.empty_session_variables | 供 SHOW VARIABLES 读取的会话系统变量名和值。 | SQL |
mys_informa_schema.functions | information_schema.functions | 供 SHOW FUNCTION 或 PROCEDURE STATUS 读取的例程名称和属性。 | SQL |
mys_informa_schema.indexs | information_schema.indexs | 按 SHOW 所需的格式列出索引列与约束键。 | SQL |
mys_informa_schema.key_column_usage | information_schema.key_column_usage | 键所涉及的列及外键引用列。 | SQL |
mys_informa_schema.parameters | information_schema.parameters | 例程参数的位置、名称和 SQL 类型。 | SQL |
mys_informa_schema.partitions | information_schema.partitions | 分区名、分区方式和系统目录估算值。 | SQL |
mys_informa_schema.procedures | information_schema.procedures | 供 SHOW FUNCTION 或 PROCEDURE STATUS 读取的例程名称和属性。 | SQL |
mys_informa_schema.referential_constraints | information_schema.referential_constraints | 外键、引用表及引用动作。 | SQL |
mys_informa_schema.routines | information_schema.routines | 从 pg_proc 读取的过程与函数元数据。 | SQL |
mys_informa_schema.schemata | information_schema.schemata | 按 PostgreSQL schema 列出 MySQL 数据库名。 | SQL |
mys_informa_schema.statistics | information_schema.statistics | 每个索引键占一行,列出键序及前缀长度。 | SQL |
mys_informa_schema.table_constraints | information_schema.table_constraints | 各表的约束名称和种类。 | SQL |
mys_informa_schema.tables | information_schema.tables | 表与视图的名称及 MySQL 表类型。 | SQL |
mys_informa_schema.triggers | information_schema.triggers | 触发器名称、触发时机及动作元数据。 | SQL |
mys_informa_schema.views | information_schema.views | 视图名称和 MySQL 兼容属性。 | SQL |
mysql
| PostgreSQL 对象 | MySQL 名称 | 用途 | 源码定义 |
|---|---|---|---|
mysql.dual | mysql.dual | 为 FROM DUAL 表达式查询提供一行占位数据。 | SQL |
mysql.pending_foreign_keys | mysql.pending_foreign_keys | 列出等待引用表就绪的外键定义。 | SQL |
mysql.proc | mysql.proc | 从 pg_proc 读取的过程与函数元数据。 | SQL |
2.2.9 - 元数据表
这些实体表提供兼容元数据。预置行数取自全新安装,Performance Schema 的表初始为空。
下表列出部分字段,种子数据链接可打开该表的初始化语句。
mys_informa_schema
| PostgreSQL 对象 | MySQL 名称 | 用途 | 源码定义 |
|---|---|---|---|
mys_informa_schema.administrable_role_authorizations | information_schema.administrable_role_authorizations | 角色授权及其启用、转授状态。安装后为空表。字段包括 user, host, grantee。 | SQL |
mys_informa_schema.applicable_roles | information_schema.applicable_roles | 角色授权及其启用、转授状态。安装后为空表。字段包括 user, host, grantee。 | SQL |
mys_informa_schema.base_variables | information_schema.base_variables | MySQL 系统变量的定义、作用域和默认值。预置 198 行。字段包括 variable_name, def_value, conf_value。 | SQL · 种子数据 |
mys_informa_schema.character_sets | information_schema.character_sets | 字符集名称、说明和默认排序规则。预置 41 行。字段包括 character_set_name, default_collate_name, description。 | SQL · 种子数据 |
mys_informa_schema.charsets | information_schema.charsets | 字符集名称、说明和默认排序规则。预置 1 行。字段包括 charset, description, default collation。 | SQL · 种子数据 |
mys_informa_schema.check_constraints | information_schema.check_constraints | 检查约束名称与表达式。安装后为空表。字段包括 constraint_catalog, constraint_schema, constraint_name。 | SQL |
mys_informa_schema.collation_character_set_applicability | information_schema.collation_character_set_applicability | 各排序规则适用的字符集。预置 286 行。字段包括 collation_name, character_set_name。 | SQL · 种子数据 |
mys_informa_schema.collations | information_schema.collations | 排序规则名称、编号和字符集。预置 286 行。字段包括 collation_name, character_set_name, id。 | SQL · 种子数据 |
mys_informa_schema.column_privileges | information_schema.column_privileges | 供 column privileges 元数据查询使用。安装后为空表。字段包括 grantee, table_catalog, table_schema。 | SQL |
mys_informa_schema.column_statistics | information_schema.column_statistics | 供 column statistics 元数据查询使用。安装后为空表。字段包括 schema_name, table_name, column_name。 | SQL |
mys_informa_schema.columns_extensions | information_schema.columns_extensions | 目录对象的扩展元数据字段。预置 3,576 行。字段包括 table_catalog, table_schema, table_name。 | SQL · 种子数据 |
mys_informa_schema.enabled_roles | information_schema.enabled_roles | 角色授权及其启用、转授状态。安装后为空表。字段包括 role_name, role_host, is_default。 | SQL |
mys_informa_schema.engines | information_schema.engines | 存储引擎名称及兼容目录报告的能力。预置 9 行。字段包括 engine, support, comment。 | SQL · 种子数据 |
mys_informa_schema.events | information_schema.events | 供 events 元数据查询使用。安装后为空表。字段包括 event_catalog, event_schema, event_name。 | SQL |
mys_informa_schema.files | information_schema.files | 供 files 元数据查询使用。安装后为空表。字段包括 file_id, file_name, file_type。 | SQL |
mys_informa_schema.innodb_buffer_page | information_schema.innodb_buffer_page | 兼容 InnoDB 的 buffer page 元数据查询。安装后为空表。字段包括 pool_id, block_id, space。 | SQL |
mys_informa_schema.innodb_buffer_page_lru | information_schema.innodb_buffer_page_lru | 兼容 InnoDB 的 buffer page lru 元数据查询。安装后为空表。字段包括 pool_id, lru_position, space。 | SQL |
mys_informa_schema.innodb_buffer_pool_stats | information_schema.innodb_buffer_pool_stats | 兼容 InnoDB 的 buffer pool stats 元数据查询。安装后为空表。字段包括 pool_id, pool_size, free_buffers。 | SQL |
mys_informa_schema.innodb_cached_indexes | information_schema.innodb_cached_indexes | 兼容 InnoDB 的 cached indexes 元数据查询。安装后为空表。字段包括 space_id, index_id, n_cached_pages。 | SQL |
mys_informa_schema.innodb_cmp | information_schema.innodb_cmp | 兼容 InnoDB 的 cmp 元数据查询。安装后为空表。字段包括 page_size, compress_ops, compress_ops_ok。 | SQL |
mys_informa_schema.innodb_cmp_per_index | information_schema.innodb_cmp_per_index | 兼容 InnoDB 的 cmp per index 元数据查询。安装后为空表。字段包括 database_name, table_name, index_name。 | SQL |
mys_informa_schema.innodb_cmp_per_index_reset | information_schema.innodb_cmp_per_index_reset | 兼容 InnoDB 的 cmp per index reset 元数据查询。安装后为空表。字段包括 database_name, table_name, index_name。 | SQL |
mys_informa_schema.innodb_cmp_reset | information_schema.innodb_cmp_reset | 兼容 InnoDB 的 cmp reset 元数据查询。安装后为空表。字段包括 page_size, compress_ops, compress_ops_ok。 | SQL |
mys_informa_schema.innodb_cmpmem | information_schema.innodb_cmpmem | 兼容 InnoDB 的 cmpmem 元数据查询。安装后为空表。字段包括 page_size, buffer_pool_instance, pages_used。 | SQL |
mys_informa_schema.innodb_cmpmem_reset | information_schema.innodb_cmpmem_reset | 兼容 InnoDB 的 cmpmem reset 元数据查询。安装后为空表。字段包括 page_size, buffer_pool_instance, pages_used。 | SQL |
mys_informa_schema.innodb_columns | information_schema.innodb_columns | 兼容 InnoDB 的 columns 元数据查询。安装后为空表。字段包括 table_id, name, pos。 | SQL |
mys_informa_schema.innodb_datafiles | information_schema.innodb_datafiles | 兼容 InnoDB 的 datafiles 元数据查询。安装后为空表。字段包括 space, path。 | SQL |
mys_informa_schema.innodb_fields | information_schema.innodb_fields | 兼容 InnoDB 的 fields 元数据查询。安装后为空表。字段包括 index_id, name, pos。 | SQL |
mys_informa_schema.innodb_foreign | information_schema.innodb_foreign | 兼容 InnoDB 的 foreign 元数据查询。安装后为空表。字段包括 id, for_name, ref_name。 | SQL |
mys_informa_schema.innodb_foreign_cols | information_schema.innodb_foreign_cols | 兼容 InnoDB 的 foreign cols 元数据查询。安装后为空表。字段包括 id, for_col_name, ref_col_name。 | SQL |
mys_informa_schema.innodb_ft_being_deleted | information_schema.innodb_ft_being_deleted | 兼容 InnoDB 的 ft being deleted 元数据查询。安装后为空表。字段包括 doc_id。 | SQL |
mys_informa_schema.innodb_ft_config | information_schema.innodb_ft_config | 兼容 InnoDB 的 ft config 元数据查询。安装后为空表。字段包括 key_, value_。 | SQL |
mys_informa_schema.innodb_ft_default_stopword | information_schema.innodb_ft_default_stopword | 兼容 InnoDB 的 ft default stopword 元数据查询。安装后为空表。字段包括 value。 | SQL |
mys_informa_schema.innodb_ft_deleted | information_schema.innodb_ft_deleted | 兼容 InnoDB 的 ft deleted 元数据查询。安装后为空表。字段包括 doc_id。 | SQL |
mys_informa_schema.innodb_ft_index_cache | information_schema.innodb_ft_index_cache | 兼容 InnoDB 的 ft index cache 元数据查询。安装后为空表。字段包括 word, first_doc_id, last_doc_id。 | SQL |
mys_informa_schema.innodb_ft_index_table | information_schema.innodb_ft_index_table | 兼容 InnoDB 的 ft index table 元数据查询。安装后为空表。字段包括 word, first_doc_id, last_doc_id。 | SQL |
mys_informa_schema.innodb_indexes | information_schema.innodb_indexes | 兼容 InnoDB 的 indexes 元数据查询。安装后为空表。字段包括 index_id, name, table_id。 | SQL |
mys_informa_schema.innodb_metrics | information_schema.innodb_metrics | 兼容 InnoDB 的 metrics 元数据查询。安装后为空表。字段包括 name, subsystem, count。 | SQL |
mys_informa_schema.innodb_session_temp_tablespaces | information_schema.innodb_session_temp_tablespaces | 兼容 InnoDB 的 session temp tablespaces 元数据查询。安装后为空表。字段包括 id, space, path。 | SQL |
mys_informa_schema.innodb_tables | information_schema.innodb_tables | 兼容 InnoDB 的 tables 元数据查询。安装后为空表。字段包括 table_id, name, flag。 | SQL |
mys_informa_schema.innodb_tablespaces | information_schema.innodb_tablespaces | 兼容 InnoDB 的 tablespaces 元数据查询。安装后为空表。字段包括 space, name, flag。 | SQL |
mys_informa_schema.innodb_tablespaces_brief | information_schema.innodb_tablespaces_brief | 兼容 InnoDB 的 tablespaces brief 元数据查询。安装后为空表。字段包括 space, name, path。 | SQL |
mys_informa_schema.innodb_tablestats | information_schema.innodb_tablestats | 兼容 InnoDB 的 tablestats 元数据查询。安装后为空表。字段包括 table_id, name, stats_initialized。 | SQL |
mys_informa_schema.innodb_temp_table_info | information_schema.innodb_temp_table_info | 兼容 InnoDB 的 temp table info 元数据查询。安装后为空表。字段包括 table_id, name, n_cols。 | SQL |
mys_informa_schema.innodb_virtual | information_schema.innodb_virtual | 兼容 InnoDB 的 virtual 元数据查询。安装后为空表。字段包括 table_id, pos, base_pos。 | SQL |
mys_informa_schema.keywords | information_schema.keywords | MySQL 关键字及保留字标记。预置 747 行。字段包括 word, reserved。 | SQL · 种子数据 |
mys_informa_schema.optimizer_trace | information_schema.optimizer_trace | 供 optimizer trace 元数据查询使用。安装后为空表。字段包括 query, trace, missing_bytes_beyond_max_mem_size。 | SQL |
mys_informa_schema.plugins | information_schema.plugins | 供 plugins 元数据查询使用。安装后为空表。字段包括 name, status, type。 | SQL |
mys_informa_schema.processlist | information_schema.processlist | 连接列表查询使用的会话与语句字段。安装后为空表。字段包括 id, user, host。 | SQL |
mys_informa_schema.profiling | information_schema.profiling | 供 profiling 元数据查询使用。安装后为空表。字段包括 query_id, seq, state。 | SQL |
mys_informa_schema.resource_groups | information_schema.resource_groups | 供 resource groups 元数据查询使用。安装后为空表。字段包括 resource_group_name, resource_group_type, resource_group_enabled。 | SQL |
mys_informa_schema.role_column_grants | information_schema.role_column_grants | 供 role column grants 元数据查询使用。安装后为空表。字段包括 grantor, grantor_host, grantee。 | SQL |
mys_informa_schema.role_routine_grants | information_schema.role_routine_grants | 供 role routine grants 元数据查询使用。安装后为空表。字段包括 grantor, grantor_host, grantee。 | SQL |
mys_informa_schema.role_table_grants | information_schema.role_table_grants | 供 role table grants 元数据查询使用。安装后为空表。字段包括 grantor, grantor_host, grantee。 | SQL |
mys_informa_schema.schema_privileges | information_schema.schema_privileges | 供 schema privileges 元数据查询使用。安装后为空表。字段包括 grantee, table_catalog, table_schema。 | SQL |
mys_informa_schema.st_geometry_columns | information_schema.st_geometry_columns | 供 st geometry columns 元数据查询使用。安装后为空表。字段包括 table_catalog, table_schema, table_name。 | SQL |
mys_informa_schema.st_spatial_reference_systems | information_schema.st_spatial_reference_systems | 空间参考系定义。安装脚本中的 SRS 种子语句均已注释。 | SQL |
mys_informa_schema.st_units_of_measure | information_schema.st_units_of_measure | 供 st units of measure 元数据查询使用。安装后为空表。字段包括 unit_name, unit_type, conversion_factor。 | SQL |
mys_informa_schema.table_constraints_extensions | information_schema.table_constraints_extensions | 目录对象的扩展元数据字段。安装后为空表。字段包括 constraint_catalog, constraint_schema, constraint_name。 | SQL |
mys_informa_schema.table_privileges | information_schema.table_privileges | 供 table privileges 元数据查询使用。安装后为空表。字段包括 grantee, table_catalog, table_schema。 | SQL |
mys_informa_schema.tables_extensions | information_schema.tables_extensions | 目录对象的扩展元数据字段。安装后为空表。字段包括 table_catalog, table_schema, table_name。 | SQL |
mys_informa_schema.tablespaces | information_schema.tablespaces | 供 tablespaces 元数据查询使用。安装后为空表。字段包括 tablespace_name, engine, tablespace_type。 | SQL |
mys_informa_schema.tablespaces_extensions | information_schema.tablespaces_extensions | 目录对象的扩展元数据字段。安装后为空表。字段包括 tablespace_name, engine_attribute。 | SQL |
mys_informa_schema.user_attributes | information_schema.user_attributes | 供 user attributes 元数据查询使用。安装后为空表。字段包括 user, host, attribute。 | SQL |
mys_informa_schema.user_privileges | information_schema.user_privileges | 供 user privileges 元数据查询使用。安装后为空表。字段包括 grantee, table_catalog, privilege_type。 | SQL |
mys_informa_schema.view_routine_usage | information_schema.view_routine_usage | 供 view routine usage 元数据查询使用。安装后为空表。字段包括 table_catalog, table_schema, table_name。 | SQL |
mys_informa_schema.view_table_usage | information_schema.view_table_usage | 供 view table usage 元数据查询使用。安装后为空表。字段包括 view_catalog, view_schema, view_name。 | SQL |
mys_sys
| PostgreSQL 对象 | MySQL 名称 | 用途 | 源码定义 |
|---|---|---|---|
mys_sys.innodb_lock_waits | sys.innodb_lock_waits | 锁请求与阻塞方信息。安装后为空表。字段包括 wait_started, wait_age, wait_age_secs。 | SQL |
mysql
| PostgreSQL 对象 | MySQL 名称 | 用途 | 源码定义 |
|---|---|---|---|
mysql."user" | mysql.user | mysql.user 查询使用的账户、认证和权限字段。安装后为空表。字段包括 host, user, select_priv。 | SQL |
performance_schema
| PostgreSQL 对象 | MySQL 名称 | 用途 | 源码定义 |
|---|---|---|---|
performance_schema.accounts | performance_schema.accounts | 按账户、主机或用户组织的连接计数。安装后为空表。字段包括 user, host, current_connections。 | SQL |
performance_schema.binary_log_transaction_compression_stats | performance_schema.binary_log_transaction_compression_stats | 供 binary log transaction compression stats 元数据查询使用。安装后为空表。字段包括 log_type, compression_type, transaction_counter。 | SQL |
performance_schema.cond_instances | performance_schema.cond_instances | 供 cond instances 元数据查询使用。安装后为空表。字段包括 name, object_instance_begin。 | SQL |
performance_schema.data_lock_waits | performance_schema.data_lock_waits | 锁请求与阻塞方信息。安装后为空表。字段包括 engine, requesting_engine_lock_id, requesting_engine_transaction_id。 | SQL |
performance_schema.data_locks | performance_schema.data_locks | 锁标识、持有者与锁模式。安装后为空表。字段包括 engine, engine_lock_id, engine_transaction_id。 | SQL |
performance_schema.error_log | performance_schema.error_log | 供 error log 元数据查询使用。安装后为空表。字段包括 logged, thread_id, prio。 | SQL |
performance_schema.events_errors_summary_by_account_by_error | performance_schema.events_errors_summary_by_account_by_error | 错误事件的汇总指标。安装后为空表。字段包括 user, host, error_number。 | SQL |
performance_schema.events_errors_summary_by_host_by_error | performance_schema.events_errors_summary_by_host_by_error | 错误事件的汇总指标。安装后为空表。字段包括 host, error_number, error_name。 | SQL |
performance_schema.events_errors_summary_by_thread_by_error | performance_schema.events_errors_summary_by_thread_by_error | 错误事件的汇总指标。安装后为空表。字段包括 thread_id, error_number, error_name。 | SQL |
performance_schema.events_errors_summary_by_user_by_error | performance_schema.events_errors_summary_by_user_by_error | 错误事件的汇总指标。安装后为空表。字段包括 user, error_number, error_name。 | SQL |
performance_schema.events_errors_summary_global_by_error | performance_schema.events_errors_summary_global_by_error | 错误事件的汇总指标。安装后为空表。字段包括 error_number, error_name, sql_state。 | SQL |
performance_schema.events_stages_current | performance_schema.events_stages_current | 阶段事件的当前记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_stages_history | performance_schema.events_stages_history | 阶段事件的历史记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_stages_history_long | performance_schema.events_stages_history_long | 阶段事件的历史记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_stages_summary_by_account_by_event_name | performance_schema.events_stages_summary_by_account_by_event_name | 阶段事件的汇总指标。安装后为空表。字段包括 user, host, event_name。 | SQL |
performance_schema.events_stages_summary_by_host_by_event_name | performance_schema.events_stages_summary_by_host_by_event_name | 阶段事件的汇总指标。安装后为空表。字段包括 host, event_name, count_star。 | SQL |
performance_schema.events_stages_summary_by_thread_by_event_name | performance_schema.events_stages_summary_by_thread_by_event_name | 阶段事件的汇总指标。安装后为空表。字段包括 thread_id, event_name, count_star。 | SQL |
performance_schema.events_stages_summary_by_user_by_event_name | performance_schema.events_stages_summary_by_user_by_event_name | 阶段事件的汇总指标。安装后为空表。字段包括 user, event_name, count_star。 | SQL |
performance_schema.events_stages_summary_global_by_event_name | performance_schema.events_stages_summary_global_by_event_name | 阶段事件的汇总指标。安装后为空表。字段包括 event_name, count_star, sum_timer_wait。 | SQL |
performance_schema.events_statements_current | performance_schema.events_statements_current | 语句事件的当前记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_statements_histogram_by_digest | performance_schema.events_statements_histogram_by_digest | 语句事件的直方图。安装后为空表。字段包括 schema_name, digest, bucket_number。 | SQL |
performance_schema.events_statements_histogram_global | performance_schema.events_statements_histogram_global | 语句事件的直方图。安装后为空表。字段包括 bucket_number, bucket_timer_low, bucket_timer_high。 | SQL |
performance_schema.events_statements_history | performance_schema.events_statements_history | 语句事件的历史记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_statements_history_long | performance_schema.events_statements_history_long | 语句事件的历史记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_statements_summary_by_account_by_event_name | performance_schema.events_statements_summary_by_account_by_event_name | 语句事件的汇总指标。安装后为空表。字段包括 user, host, event_name。 | SQL |
performance_schema.events_statements_summary_by_digest | performance_schema.events_statements_summary_by_digest | 语句事件的汇总指标。安装后为空表。字段包括 schema_name, digest, digest_text。 | SQL |
performance_schema.events_statements_summary_by_host_by_event_name | performance_schema.events_statements_summary_by_host_by_event_name | 语句事件的汇总指标。安装后为空表。字段包括 host, event_name, count_star。 | SQL |
performance_schema.events_statements_summary_by_program | performance_schema.events_statements_summary_by_program | 语句事件的汇总指标。安装后为空表。字段包括 object_type, object_schema, object_name。 | SQL |
performance_schema.events_statements_summary_by_thread_by_event_name | performance_schema.events_statements_summary_by_thread_by_event_name | 语句事件的汇总指标。安装后为空表。字段包括 thread_id, event_name, count_star。 | SQL |
performance_schema.events_statements_summary_by_user_by_event_name | performance_schema.events_statements_summary_by_user_by_event_name | 语句事件的汇总指标。安装后为空表。字段包括 user, event_name, count_star。 | SQL |
performance_schema.events_statements_summary_global_by_event_name | performance_schema.events_statements_summary_global_by_event_name | 语句事件的汇总指标。安装后为空表。字段包括 event_name, count_star, sum_timer_wait。 | SQL |
performance_schema.events_transactions_current | performance_schema.events_transactions_current | 事务事件的当前记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_transactions_history | performance_schema.events_transactions_history | 事务事件的历史记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_transactions_history_long | performance_schema.events_transactions_history_long | 事务事件的历史记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_transactions_summary_by_account_by_event_name | performance_schema.events_transactions_summary_by_account_by_event_name | 事务事件的汇总指标。安装后为空表。字段包括 user, host, event_name。 | SQL |
performance_schema.events_transactions_summary_by_host_by_event_name | performance_schema.events_transactions_summary_by_host_by_event_name | 事务事件的汇总指标。安装后为空表。字段包括 host, event_name, count_star。 | SQL |
performance_schema.events_transactions_summary_by_thread_by_event_name | performance_schema.events_transactions_summary_by_thread_by_event_name | 事务事件的汇总指标。安装后为空表。字段包括 thread_id, event_name, count_star。 | SQL |
performance_schema.events_transactions_summary_by_user_by_event_name | performance_schema.events_transactions_summary_by_user_by_event_name | 事务事件的汇总指标。安装后为空表。字段包括 user, event_name, count_star。 | SQL |
performance_schema.events_transactions_summary_global_by_event_name | performance_schema.events_transactions_summary_global_by_event_name | 事务事件的汇总指标。安装后为空表。字段包括 event_name, count_star, sum_timer_wait。 | SQL |
performance_schema.events_waits_current | performance_schema.events_waits_current | 等待事件的当前记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_waits_history | performance_schema.events_waits_history | 等待事件的历史记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_waits_history_long | performance_schema.events_waits_history_long | 等待事件的历史记录。安装后为空表。字段包括 thread_id, event_id, end_event_id。 | SQL |
performance_schema.events_waits_summary_by_account_by_event_name | performance_schema.events_waits_summary_by_account_by_event_name | 等待事件的汇总指标。安装后为空表。字段包括 user, host, event_name。 | SQL |
performance_schema.events_waits_summary_by_host_by_event_name | performance_schema.events_waits_summary_by_host_by_event_name | 等待事件的汇总指标。安装后为空表。字段包括 host, event_name, count_star。 | SQL |
performance_schema.events_waits_summary_by_instance | performance_schema.events_waits_summary_by_instance | 等待事件的汇总指标。安装后为空表。字段包括 event_name, object_instance_begin, count_star。 | SQL |
performance_schema.events_waits_summary_by_thread_by_event_name | performance_schema.events_waits_summary_by_thread_by_event_name | 等待事件的汇总指标。安装后为空表。字段包括 thread_id, event_name, count_star。 | SQL |
performance_schema.events_waits_summary_by_user_by_event_name | performance_schema.events_waits_summary_by_user_by_event_name | 等待事件的汇总指标。安装后为空表。字段包括 user, event_name, count_star。 | SQL |
performance_schema.events_waits_summary_global_by_event_name | performance_schema.events_waits_summary_global_by_event_name | 等待事件的汇总指标。安装后为空表。字段包括 event_name, count_star, sum_timer_wait。 | SQL |
performance_schema.file_instances | performance_schema.file_instances | 供 file instances 元数据查询使用。安装后为空表。字段包括 file_name, event_name, open_count。 | SQL |
performance_schema.file_summary_by_event_name | performance_schema.file_summary_by_event_name | 供 file summary by event name 元数据查询使用。安装后为空表。字段包括 event_name, count_star, sum_timer_wait。 | SQL |
performance_schema.file_summary_by_instance | performance_schema.file_summary_by_instance | 供 file summary by instance 元数据查询使用。安装后为空表。字段包括 file_name, event_name, object_instance_begin。 | SQL |
performance_schema.global_status | performance_schema.global_status | 供 global status 元数据查询使用。安装后为空表。字段包括 variable_name, variable_value。 | SQL |
performance_schema.global_variables | performance_schema.global_variables | 供 global variables 元数据查询使用。安装后为空表。字段包括 variable_name, variable_value。 | SQL |
performance_schema.host_cache | performance_schema.host_cache | 供 host cache 元数据查询使用。安装后为空表。字段包括 ip, host, host_validated。 | SQL |
performance_schema.hosts | performance_schema.hosts | 按账户、主机或用户组织的连接计数。安装后为空表。字段包括 host, current_connections, total_connections。 | SQL |
performance_schema.innodb_redo_log_files | performance_schema.innodb_redo_log_files | 兼容 InnoDB 的 redo log files 元数据查询。安装后为空表。字段包括 file_id, file_name, start_lsn。 | SQL |
performance_schema.keyring_component_status | performance_schema.keyring_component_status | 供 keyring component status 元数据查询使用。安装后为空表。字段包括 status_key, status_value。 | SQL |
performance_schema.keyring_keys | performance_schema.keyring_keys | 供 keyring keys 元数据查询使用。安装后为空表。字段包括 key_id, key_owner, backend_key_id。 | SQL |
performance_schema.log_status | performance_schema.log_status | 供 log status 元数据查询使用。安装后为空表。字段包括 server_uuid, local, replication。 | SQL |
performance_schema.memory_summary_by_account_by_event_name | performance_schema.memory_summary_by_account_by_event_name | 供 memory summary by account by event name 元数据查询使用。安装后为空表。字段包括 user, host, event_name。 | SQL |
performance_schema.memory_summary_by_host_by_event_name | performance_schema.memory_summary_by_host_by_event_name | 供 memory summary by host by event name 元数据查询使用。安装后为空表。字段包括 host, event_name, count_alloc。 | SQL |
performance_schema.memory_summary_by_thread_by_event_name | performance_schema.memory_summary_by_thread_by_event_name | 供 memory summary by thread by event name 元数据查询使用。安装后为空表。字段包括 thread_id, event_name, count_alloc。 | SQL |
performance_schema.memory_summary_by_user_by_event_name | performance_schema.memory_summary_by_user_by_event_name | 供 memory summary by user by event name 元数据查询使用。安装后为空表。字段包括 user, event_name, count_alloc。 | SQL |
performance_schema.memory_summary_global_by_event_name | performance_schema.memory_summary_global_by_event_name | 供 memory summary global by event name 元数据查询使用。安装后为空表。字段包括 event_name, count_alloc, count_free。 | SQL |
performance_schema.metadata_locks | performance_schema.metadata_locks | 锁标识、持有者与锁模式。安装后为空表。字段包括 object_type, object_schema, object_name。 | SQL |
performance_schema.mutex_instances | performance_schema.mutex_instances | 供 mutex instances 元数据查询使用。安装后为空表。字段包括 name, object_instance_begin, locked_by_thread_id。 | SQL |
performance_schema.objects_summary_global_by_type | performance_schema.objects_summary_global_by_type | 供 objects summary global by type 元数据查询使用。安装后为空表。字段包括 object_type, object_schema, object_name。 | SQL |
performance_schema.performance_timers | performance_schema.performance_timers | 供 performance timers 元数据查询使用。安装后为空表。字段包括 timer_name, timer_frequency, timer_resolution。 | SQL |
performance_schema.persisted_variables | performance_schema.persisted_variables | 供 persisted variables 元数据查询使用。安装后为空表。字段包括 variable_name, variable_value。 | SQL |
performance_schema.prepared_statements_instances | performance_schema.prepared_statements_instances | 供 prepared statements instances 元数据查询使用。安装后为空表。字段包括 object_instance_begin, statement_id, statement_name。 | SQL |
performance_schema.processlist | performance_schema.processlist | 连接列表查询使用的会话与语句字段。安装后为空表。字段包括 id, user, host。 | SQL |
performance_schema.replication_applier_configuration | performance_schema.replication_applier_configuration | 兼容 MySQL 复制的 applier configuration 元数据查询。安装后为空表。字段包括 channel_name, desired_delay, privilege_checks_user。 | SQL |
performance_schema.replication_applier_filters | performance_schema.replication_applier_filters | 兼容 MySQL 复制的 applier filters 元数据查询。安装后为空表。字段包括 channel_name, filter_name, filter_rule。 | SQL |
performance_schema.replication_applier_global_filters | performance_schema.replication_applier_global_filters | 兼容 MySQL 复制的 applier global filters 元数据查询。安装后为空表。字段包括 filter_name, filter_rule, configured_by。 | SQL |
performance_schema.replication_applier_status | performance_schema.replication_applier_status | 兼容 MySQL 复制的 applier status 元数据查询。安装后为空表。字段包括 channel_name, service_state, remaining_delay。 | SQL |
performance_schema.replication_applier_status_by_coordinator | performance_schema.replication_applier_status_by_coordinator | 兼容 MySQL 复制的 applier status by coordinator 元数据查询。安装后为空表。字段包括 channel_name, thread_id, service_state。 | SQL |
performance_schema.replication_applier_status_by_worker | performance_schema.replication_applier_status_by_worker | 兼容 MySQL 复制的 applier status by worker 元数据查询。安装后为空表。字段包括 channel_name, worker_id, thread_id。 | SQL |
performance_schema.replication_asynchronous_connection_failover | performance_schema.replication_asynchronous_connection_failover | 兼容 MySQL 复制的 asynchronous connection failover 元数据查询。安装后为空表。字段包括 channel_name, host, port。 | SQL |
performance_schema.replication_asynchronous_connection_failover_managed | performance_schema.replication_asynchronous_connection_failover_managed | 兼容 MySQL 复制的 asynchronous connection failover managed 元数据查询。安装后为空表。字段包括 channel_name, managed_name, managed_type。 | SQL |
performance_schema.replication_connection_configuration | performance_schema.replication_connection_configuration | 兼容 MySQL 复制的 connection configuration 元数据查询。安装后为空表。字段包括 channel_name, host, port。 | SQL |
performance_schema.replication_connection_status | performance_schema.replication_connection_status | 兼容 MySQL 复制的 connection status 元数据查询。安装后为空表。字段包括 channel_name, group_name, source_uuid。 | SQL |
performance_schema.replication_group_member_stats | performance_schema.replication_group_member_stats | 兼容 MySQL 复制的 group member stats 元数据查询。安装后为空表。字段包括 channel_name, view_id, member_id。 | SQL |
performance_schema.replication_group_members | performance_schema.replication_group_members | 兼容 MySQL 复制的 group members 元数据查询。安装后为空表。字段包括 channel_name, member_id, member_host。 | SQL |
performance_schema.rwlock_instances | performance_schema.rwlock_instances | 供 rwlock instances 元数据查询使用。安装后为空表。字段包括 name, object_instance_begin, write_locked_by_thread_id。 | SQL |
performance_schema.session_account_connect_attrs | performance_schema.session_account_connect_attrs | 供 session account connect attrs 元数据查询使用。安装后为空表。字段包括 processlist_id, attr_name, attr_value。 | SQL |
performance_schema.session_connect_attrs | performance_schema.session_connect_attrs | 供 session connect attrs 元数据查询使用。安装后为空表。字段包括 processlist_id, attr_name, attr_value。 | SQL |
performance_schema.session_status | performance_schema.session_status | 供 session status 元数据查询使用。安装后为空表。字段包括 variable_name, variable_value。 | SQL |
performance_schema.session_variables | performance_schema.session_variables | 供 session variables 元数据查询使用。安装后为空表。字段包括 variable_name, variable_value。 | SQL |
performance_schema.setup_actors | performance_schema.setup_actors | 供 setup actors 元数据查询使用。安装后为空表。字段包括 host, user, role。 | SQL |
performance_schema.setup_consumers | performance_schema.setup_consumers | 供 setup consumers 元数据查询使用。安装后为空表。字段包括 name, enabled。 | SQL |
performance_schema.setup_instruments | performance_schema.setup_instruments | 供 setup instruments 元数据查询使用。安装后为空表。字段包括 name, enabled, timed。 | SQL |
performance_schema.setup_objects | performance_schema.setup_objects | 供 setup objects 元数据查询使用。安装后为空表。字段包括 object_type, object_schema, object_name。 | SQL |
performance_schema.setup_threads | performance_schema.setup_threads | 供 setup threads 元数据查询使用。安装后为空表。字段包括 name, enabled, history。 | SQL |
performance_schema.socket_instances | performance_schema.socket_instances | 供 socket instances 元数据查询使用。安装后为空表。字段包括 event_name, object_instance_begin, thread_id。 | SQL |
performance_schema.socket_summary_by_event_name | performance_schema.socket_summary_by_event_name | 供 socket summary by event name 元数据查询使用。安装后为空表。字段包括 event_name, count_star, sum_timer_wait。 | SQL |
performance_schema.socket_summary_by_instance | performance_schema.socket_summary_by_instance | 供 socket summary by instance 元数据查询使用。安装后为空表。字段包括 event_name, object_instance_begin, count_star。 | SQL |
performance_schema.status_by_account | performance_schema.status_by_account | 供 status by account 元数据查询使用。安装后为空表。字段包括 user, host, variable_name。 | SQL |
performance_schema.status_by_host | performance_schema.status_by_host | 供 status by host 元数据查询使用。安装后为空表。字段包括 host, variable_name, variable_value。 | SQL |
performance_schema.status_by_thread | performance_schema.status_by_thread | 供 status by thread 元数据查询使用。安装后为空表。字段包括 thread_id, variable_name, variable_value。 | SQL |
performance_schema.status_by_user | performance_schema.status_by_user | 供 status by user 元数据查询使用。安装后为空表。字段包括 user, variable_name, variable_value。 | SQL |
performance_schema.table_handles | performance_schema.table_handles | 供 table handles 元数据查询使用。安装后为空表。字段包括 object_type, object_schema, object_name。 | SQL |
performance_schema.table_io_waits_summary_by_index_usage | performance_schema.table_io_waits_summary_by_index_usage | 供 table io waits summary by index usage 元数据查询使用。安装后为空表。字段包括 object_type, object_schema, object_name。 | SQL |
performance_schema.table_io_waits_summary_by_table | performance_schema.table_io_waits_summary_by_table | 供 table io waits summary by table 元数据查询使用。安装后为空表。字段包括 object_type, object_schema, object_name。 | SQL |
performance_schema.table_lock_waits_summary_by_table | performance_schema.table_lock_waits_summary_by_table | 供 table lock waits summary by table 元数据查询使用。安装后为空表。字段包括 object_type, object_schema, object_name。 | SQL |
performance_schema.threads | performance_schema.threads | 供 threads 元数据查询使用。安装后为空表。字段包括 thread_id, name, type。 | SQL |
performance_schema.tls_channel_status | performance_schema.tls_channel_status | 供 tls channel status 元数据查询使用。安装后为空表。字段包括 channel, property, value。 | SQL |
performance_schema.user_defined_functions | performance_schema.user_defined_functions | 供 user defined functions 元数据查询使用。安装后为空表。字段包括 udf_name, udf_return_type, udf_type。 | SQL |
performance_schema.user_variables_by_thread | performance_schema.user_variables_by_thread | 供 user variables by thread 元数据查询使用。安装后为空表。字段包括 thread_id, variable_name, variable_value。 | SQL |
performance_schema.users | performance_schema.users | 按账户、主机或用户组织的连接计数。安装后为空表。字段包括 user, current_connections, total_connections。 | SQL |
performance_schema.variables_by_thread | performance_schema.variables_by_thread | 供 variables by thread 元数据查询使用。安装后为空表。字段包括 thread_id, variable_name, variable_value。 | SQL |
performance_schema.variables_info | performance_schema.variables_info | 供 variables info 元数据查询使用。安装后为空表。字段包括 variable_name, variable_source, variable_path。 | SQL |
2.2.10 - 索引访问方法、运算符类与族
按访问方法和类型查找默认运算符类及所属族。同一名称可同时指类和族。
建类时省略 FAMILY 会创建同名族。binary_n 和 varbinary_n 的 B-tree、哈希运算符类分别加入已有的 pg_catalog.bytea_ops 族。
运算符类
运算符族
访问方法
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
mysql_prefix | 用于 MySQL 前缀键的索引访问方法。 | SQL |
2.2.11 - 运算符族成员
按族、访问方法、策略号或支持函数编号及类型对查找,每行列出实际注册的运算符或函数。
策略运算符
支持函数
2.2.12 - 表索引
列出兼容表上的实体索引,包括主键约束使用的唯一索引。
主键
二级索引
2.2.13 - 主键与域检查约束
按数据库分配的约束名查找所属表或域,以及实际安装的表达式。
域检查约束
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
"bigint unsigned_check" on mysql."bigint unsigned" | CHECK ((0 <= VALUE)) | SQL |
"int unsigned_check" on mysql."int unsigned" | CHECK (((0 <= VALUE) AND (VALUE <= '4294967295'::bigint))) | SQL |
"mediumint signed_check" on mysql."mediumint signed" | CHECK ((('-8388608'::integer <= VALUE) AND (VALUE <= 8388607))) | SQL |
"mediumint unsigned_check" on mysql."mediumint unsigned" | CHECK (((0 <= VALUE) AND (VALUE <= 16777215))) | SQL |
"smallint unsigned_check" on mysql."smallint unsigned" | CHECK (((0 <= VALUE) AND (VALUE <= 65535))) | SQL |
"tinyint signed_check" on mysql."tinyint signed" | CHECK ((('-128'::integer <= VALUE) AND (VALUE <= 127))) | SQL |
"tinyint unsigned_check" on mysql."tinyint unsigned" | CHECK (((0 <= VALUE) AND (VALUE <= 255))) | SQL |
"tinyint1 signed_check" on mysql."tinyint1 signed" | CHECK ((('-128'::integer <= VALUE) AND (VALUE <= 127))) | SQL |
"tinyint1 unsigned_check" on mysql."tinyint1 unsigned" | CHECK (((0 <= VALUE) AND (VALUE <= 255))) | SQL |
mediumint_check on mysql.mediumint | CHECK ((('-8388608'::integer <= VALUE) AND (VALUE <= 8388607))) | SQL |
tinyint1_check on mysql.tinyint1 | CHECK ((('-128'::integer <= VALUE) AND (VALUE <= 127))) | SQL |
tinyint_check on mysql.tinyint | CHECK ((('-128'::integer <= VALUE) AND (VALUE <= 127))) | SQL |
year__check on mysql.year_ | CHECK (((1901 <= VALUE) AND (VALUE <= 2155))) | SQL |
主键
2.2.14 - 元数据 schema 的非空约束
按所属表的首字母查找 Performance Schema 以外各元数据表的列非空约束。
A
B
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
base_variables_variable_name_not_null on mys_informa_schema.base_variables | NOT NULL variable_name(主键隐含) | SQL |
C
E
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
enabled_roles_is_mandatory_not_null on mys_informa_schema.enabled_roles | NOT NULL is_mandatory | SQL |
F
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
files_engine_not_null on mys_informa_schema.files | NOT NULL engine | SQL |
files_table_catalog_not_null on mys_informa_schema.files | NOT NULL table_catalog | SQL |
files_tablespace_name_not_null on mys_informa_schema.files | NOT NULL tablespace_name | SQL |
I
O
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
optimizer_trace_insufficient_privileges_not_null on mys_informa_schema.optimizer_trace | NOT NULL insufficient_privileges | SQL |
optimizer_trace_missing_bytes_beyond_max_mem_size_not_null on mys_informa_schema.optimizer_trace | NOT NULL missing_bytes_beyond_max_mem_size | SQL |
optimizer_trace_query_not_null on mys_informa_schema.optimizer_trace | NOT NULL query | SQL |
optimizer_trace_trace_not_null on mys_informa_schema.optimizer_trace | NOT NULL trace | SQL |
P
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
processlist_command_not_null on mys_informa_schema.processlist | NOT NULL command | SQL |
processlist_host_not_null on mys_informa_schema.processlist | NOT NULL host | SQL |
processlist_id_not_null on mys_informa_schema.processlist | NOT NULL id | SQL |
processlist_time_not_null on mys_informa_schema.processlist | NOT NULL "time" | SQL |
processlist_user_not_null on mys_informa_schema.processlist | NOT NULL "user" | SQL |
R
S
T
U
V
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
view_routine_usage_specific_name_not_null on mys_informa_schema.view_routine_usage | NOT NULL specific_name | SQL |
2.2.15 - performance_schema.events_* 非空约束
查找 Performance Schema 事件表的约束名和列定义。
E
2.2.16 - 其他 performance_schema 表的非空约束
查找 Performance Schema 其余表的约束名和列定义。
A
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
accounts_current_connections_not_null on performance_schema.accounts | NOT NULL current_connections | SQL |
accounts_total_connections_not_null on performance_schema.accounts | NOT NULL total_connections | SQL |
B
C
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
cond_instances_name_not_null on performance_schema.cond_instances | NOT NULL name | SQL |
cond_instances_object_instance_begin_not_null on performance_schema.cond_instances | NOT NULL object_instance_begin | SQL |
D
E
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
error_log_data_not_null on performance_schema.error_log | NOT NULL data | SQL |
error_log_logged_not_null on performance_schema.error_log | NOT NULL logged | SQL |
error_log_prio_not_null on performance_schema.error_log | NOT NULL prio | SQL |
F
G
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
global_status_variable_name_not_null on performance_schema.global_status | NOT NULL variable_name | SQL |
global_variables_variable_name_not_null on performance_schema.global_variables | NOT NULL variable_name | SQL |
H
I
K
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
keyring_component_status_status_key_not_null on performance_schema.keyring_component_status | NOT NULL status_key | SQL |
keyring_component_status_status_value_not_null on performance_schema.keyring_component_status | NOT NULL status_value | SQL |
keyring_keys_key_id_not_null on performance_schema.keyring_keys | NOT NULL key_id | SQL |
L
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
log_status_local_not_null on performance_schema.log_status | NOT NULL local | SQL |
log_status_replication_not_null on performance_schema.log_status | NOT NULL replication | SQL |
log_status_server_uuid_not_null on performance_schema.log_status | NOT NULL server_uuid | SQL |
log_status_storage_engines_not_null on performance_schema.log_status | NOT NULL storage_engines | SQL |
M
O
P
R
S
T
U
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
user_defined_functions_udf_name_not_null on performance_schema.user_defined_functions | NOT NULL udf_name | SQL |
user_defined_functions_udf_return_type_not_null on performance_schema.user_defined_functions | NOT NULL udf_return_type | SQL |
user_defined_functions_udf_type_not_null on performance_schema.user_defined_functions | NOT NULL udf_type | SQL |
users_current_connections_not_null on performance_schema.users | NOT NULL current_connections | SQL |
users_total_connections_not_null on performance_schema.users | NOT NULL total_connections | SQL |
V
| 对象签名 | 用途 | 源码定义 |
|---|---|---|
variables_by_thread_thread_id_not_null on performance_schema.variables_by_thread | NOT NULL thread_id | SQL |
variables_by_thread_variable_name_not_null on performance_schema.variables_by_thread | NOT NULL variable_name | SQL |
variables_info_variable_name_not_null on performance_schema.variables_info | NOT NULL variable_name | SQL |
3 - SQL 与类型兼容
本页示例使用普通 MySQL 连接,在临时 schema 中执行。原生 PostgreSQL 连接可以读到同一组行;解析规则、事务边界与驱动返回类型取决于所用入口。
两个入口的 SQL 语义
| 操作 | 19.0.1 的 MySQL 行为 | 迁移影响 |
|---|---|---|
| 建表与改列 | 支持反引号、内联 KEY、AUTO_INCREMENT、MODIFY、CHANGE。自增列由 PostgreSQL identity 序列实现。 | 导入显式键值后核对下一个生成值。变更默认值或生成表达式后实际写入一行。 |
| 查询与联表更新 | 支持反引号、LIMIT offset,count、单目标 UPDATE … JOIN 及部分 DELETE FROM target USING … 形式。 | 多目标写入及 DELETE target FROM … JOIN 需拆成单目标操作,按业务事务边界比对受影响行。 |
| 处理重复键 | ON DUPLICATE KEY UPDATE 检查唯一键。REPLACE 删除冲突行并插入新行,应用列默认值,也可能触发外键动作和触发器。 | 需要保留未指定的列或引用行时,用显式更新。普通 UPDATE 统计匹配行,含值未改变的行。 |
| 使用布尔或整数条件 | SELECT 1 WHERE 1 返回 1,向 INT 列写入 1=1 得到 1。原生 psql 会拒绝整数条件(SQLSTATE 42804)。 | 跨方言查询使用 WHERE flag <> 0。原生整数与布尔互转需要显式转换。扩展另行定义的一些类型和转换在整个库中可见。 |
| 查看或回放定义 | SHOW CREATE TABLE、SHOW COLUMNS 和 SHOW INDEX 提供 MySQL 侧定义。information_schema、SHOW STATUS 和系统变量仅覆盖部分接口。 | 在临时 schema 中重放 DDL,并从原生目录核对约束和物理存储。 |
以下四次写入实测分别影响 1、1、2、2 行。最终行为 (1,9):替换后,未指定的列使用了默认值。
类型、字节与排序规则
| 源值或 DDL | 示例库中的实际结果 | 替代表示或核对办法 |
|---|---|---|
CREATE TABLE ids(k BIGINT UNSIGNED),再 INSERT INTO ids VALUES(9223372036854775808) | 报 1264,表仍为空。目标域范围为 0 到 9223372036854775807。 | 需完整 uint64 范围时,可改用带上下界约束的 DECIMAL(20,0),同时调整驱动解码、键生成及外键。 |
CREATE TABLE cents(n DECIMAL),插入 1.6 | 读回 n 为 2,省略精度的声明表示 DECIMAL(10,0)。 | 显式指定精度和标度。原生无精度限制的 numeric 导出时可能以 decimal(65,30) 报告,并伴有警告。 |
向 TEXT 写入 0x610062,再写入 VARBINARY(4) | 文本列遇 NUL 报 1366,二进制列的 HEX(binary_column) 返回 610062。BINARY(n) 还会在末尾补零。 | 需要保存任意字节的负载应使用二进制列,比较 HEX()、长度和末尾零字节。 |
向 TIME 写入 '27:30:00',或执行 CAST('0000-00-00' AS DATE) | 两者都报 1292。这里的时间列表示一天中的时刻。 | 有符号时长可存为整数微秒,或显式转换为 PostgreSQL interval。零日期按业务约定映射为其他值或 NULL。 |
CREATE TABLE e(v ENUM('a','b')) 或 CREATE TABLE s(v SET('a','b')) | 在新库中均报 1091。 | 按成员约束和排序需求,改用带检查约束的文本、字典表或显式位掩码。 |
CREATE TABLE calc(i INT, twice INT AS(i*2) VIRTUAL),写入 i=4 | 读回 (4,8)。VIRTUAL 和 STORED 均在写入时物化。 | 使用确定性表达式,导入后比对存储值,并计入存储与写入开销。 |
重建唯一键前先比较字符
字符串按 UTF-8 存储和返回。SET NAMES 更新会话字符设置,其他编码可能近似映射并报 1105 警告。应先显式转换源端旧编码的字节,再核对解码结果。
utf8_general_ci 和 utf8mb4_general_ci 对应同一种 general-ci 实现,utf8_bin 和 utf8mb4_bin 对应同一种二进制排序实现,两者都采用 PAD SPACE。其他 MySQL 排序规则名以 _ci 结尾时映射为 general-ci 权重,其余后缀映射为二进制顺序,可能改变特定语言的等价关系、排序、唯一性及重复键的处理结果。字面量也可能与列值表现不同:在本例 C locale 数据库中,SELECT 'a'='A' 返回 0。
实测警告码为 1105,回显的有效定义包含 utf8mb4_general_ci,最后一次插入报 1062。先将候选键导入不带唯一索引的暂存表,按目标排序规则和实际前缀长度分组查重,处理冲突后再建唯一索引。
事务边界与快照
在 MySQL 会话关闭 autocommit 后,通过 COMMIT 和 ROLLBACK 划分业务事务。DDL、再次 BEGIN 和打开 autocommit 都可能提交之前的写入。在临时 schema 执行 BEGIN; INSERT INTO counters VALUES (2,7); CREATE TABLE boundary(i INT); ROLLBACK; 后,行 2 和新表都保留。把变更表结构与预期可回滚的业务写入分开。原生 PostgreSQL 会话继续使用 PostgreSQL 的事务性 DDL 和出错行为。
在 MySQL 入口,READ UNCOMMITTED、READ COMMITTED 和可写的 REPEATABLE READ 都使用 PostgreSQL 语句级快照。只读 REPEATABLE READ 和一致性快照保留事务级快照。可用两个连接验证:建表 meter(id INT PRIMARY KEY,v INT) 并写入 (1,10)。A 执行 SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ,开启下列事务并读取 v;B 提交 UPDATE meter SET v=20 WHERE id=1,A 再读。每轮前将值恢复为 10。
| A 的事务起始语句 | 第一次读 | 第二次读 |
|---|---|---|
START TRANSACTION READ WRITE | 10 | 20 |
START TRANSACTION READ ONLY | 10 | 10 |
START TRANSACTION WITH CONSISTENT SNAPSHOT | 10 | 10 |
报表需要稳定视图时显式请求快照。并发写入遇 1213 / SQLSTATE 40001 时须重试整笔事务。SERIALIZABLE 使用 PostgreSQL 隔离语义。这里没有 InnoDB 间隙锁。LOCK TABLES 和 UNLOCK TABLES 能执行,但不会取得表锁或提交事务;需要排他切换时应停写。
索引与外键
长度适当的完整键可使用原生 B-tree。真正的前缀键如 PRIMARY KEY(k(3)) 对前缀施加唯一性:转储恢复实测中,已存在 abc1 时再插入 abcZ 报 1062。前缀索引与超长索引要回表复查,不能提供仅索引扫描或排序输出。MySQL 索引提示会被接受并忽略。应检查原生执行计划,用业务键值分布实测。
表级 FOREIGN KEY(i) REFERENCES parent(i) 要求父键类型匹配,且有主键或唯一约束。父表仅有普通 KEY(i) 时实测创建失败(SQLSTATE 42830)。为父键加唯一约束前先查重。启用检查时新增孤儿行报 1452;重新开启检查不会回查已有孤儿行,批量导入后应做反连接校验。
SET FOREIGN_KEY_CHECKS=0 作用于当前会话。本版逐条外键检查:只有具备引用表(子表)的属主权限或超级用户身份,才能跳过该约束。其他角色仍受约束及父侧动作限制,并会收到警告。SECURITY DEFINER 中仍执行检查。先于父表创建的待绑定外键,在绑定时仍需相应父表权限。原生备份要保留记录其元数据的触发器。
预处理语句
下面的 SQL 级预处理实测返回 42。线缆协议级的服务端预处理另走一条路径。Go 和 JDBC 用例使用了二进制参数,核对了返回类型、错误及出错后的连接复用。驱动结果与设置
核对业务连接
CLI 登录成功可以确认可达性。HBA 认证方式与 TLS 见认证配置;JDBC 和 Go 的参数模式、返回类型、生成键及错误后的连接复用见已测客户端。
除 SQL 差异外,GTID 复制与存储过程也会影响切换方案。已知限制与排障
4 - 客户端与驱动
一次连接能证明什么
下表使用 Rocky Linux 10 x86-64 上配套的 Mimus 19.0.1 完整内核与 pg_mysql 1.0。握手可确认协议通告;简单查询覆盖解析和一次结果集返回;应用用例进一步覆盖参数传递、写入、类型解码,或从第二个连接检查事务可见性。
| 客户端 | 登录与查询 | 实际完成的工作流 |
|---|---|---|
MariaDB mysql 10.11.19 | TCP、验证证书的 TLS、持有 SCRAM 验证器的角色、选库、@@version | 普通用户建表并写读一行,原生 psql 读到相同的键和文本。 |
| PyMySQL 1.1.1 | 握手版本 5.7.32-log、utf8mb4、指定 schema | 订单用例完成参数化插入(lastrowid=1)、三行 executemany、聚合,以及 Python Decimal、datetime 解码。更新两行再回滚,按新状态计数为零;不存在的表报 1146。 |
Go database/sql + go-sql-driver/mysql 1.9.3 | 跑通默认连接和 TLS | 核对服务端参数、生成键与行数、NULL、字节、十进制数、parseTime=true 的时间类型扫描、重复键 1062 和出错后复用;提交后第二个连接才看到写入。 |
| MySQL Connector/J 8.4.0 | 默认优先 TLS、强制 TLS、另测 RSA 登录及缓存登录 | useServerPrepStmts=true 下核对预处理时的元数据、生成键、BLOB/NULL、批处理与重复键;验证 setAutoCommit(false)、回滚、提交和重新开启自动提交。 |
Oracle MySQL mysqldump 与 mysql 5.7.32 | 认证后选中用例 schema | 导出并回放支持的 DDL、视图、二进制与生成值、前缀主键和外键;恢复目标为 Mimus。恢复步骤 |
连接应用
沿用起步示例的 schema 和角色,使用 TCP,并把应用 schema 作为 database 传入。下面的 Python 示例会提示输入口令。将 MYSQL_CA 设为受信任的 CA 文件,或回环示例中的公有证书。
按应用实际模式核对预处理
PyMySQL 在这个示例中于客户端转义 %s 的取值,再发送文本 SQL。Go 驱动的默认参数路径与打开 useServerPrepStmts=true 的 Connector/J 使用二进制预处理协议。已实现 COM_STMT_PREPARE、EXECUTE、CLOSE、RESET、SEND_LONG_DATA。每次 prepare 接受一条 SQL。语句 reset 和连接级 COM_RESET_CONNECTION 作用不同:后者还会回滚活动事务并清理会话状态。使用 COM_CHANGE_USER 的连接池需要改为重建连接。
用业务驱动复核
记录驱动版本、TLS 模式、参数插值或服务端预处理、autocommit 与连接池重置行为。在临时 schema 中分别写入带引号的文本和含零字节的二进制列,核对类型与字节、重复键处理,再回滚并从第二个连接读取。本版会话事务用例通过 56 项检查。表中结论对应列出的版本;其他驱动、ORM 结构探测以及连接池仍需单独演练。
5 - 迁移与恢复
规划迁移
在新的目标集群中安装配套内核、模块和扩展 SQL,按逻辑方式迁移应用对象与数据。旧 OpenHalo 数据目录、从该版本线执行物理 pg_upgrade、原地 ALTER EXTENSION aux_mysql UPDATE,均不在此次全新安装 pg_mysql 1.0 的支持范围内。保留原始 DDL,旧库目录可能已丢失前缀长度、二进制列宽或生成表达式。
除了业务数据,还要分别盘点 PostgreSQL 角色、属主、授权与跨 schema 依赖。引用旧扩展名或 C 库的应用对象需要转换。导入前确定 uint64、时长、零日期、ENUM/SET、NUL 与排序键各自如何表示。实际差异与替代办法
恢复 PostgreSQL 原生逻辑备份
在同版 Mimus 上演练时,使用配套的 PostgreSQL 19 工具。以下示例在起步实例上,以数据库管理员身份通过原生本地套接字,将业务 schema app 恢复到新库中。app_user 已存在于同一集群;若目标是另一集群,先按审查后的定义建立角色和授权。单独导出一个 schema 时,还须收集其外部依赖。
保留 MySQL 对象的安全标签与元数据触发器,包括待绑定外键,并保留属主和审查后的权限。可以用原生 psql 检查 restore_check;MySQL 监听仍将连接送入原来配置的数据库。若要在另一个目标上验证恢复后的 MySQL 行为,应将隔离实例的 mysql.database 指向恢复库,再重新连接。
恢复 MySQL 文本转储
19.0.1 的转储回放实测使用 Oracle MySQL 5.7.32 工具。导出前先查 mysqldump --version。同名工具可能存在差异,例如 MariaDB 10.5 的转储程序可能将生成列值写入 INSERT,恢复时不能直接插入。演练期间暂停源端写入和 DDL,或采用另行验证的一致性快照。示例使用 TCP 和交互口令,需按源、目标端实际情况提供 TLS 身份验证参数与 CA。
这两条命令只复制起步示例的表。该表仅有 pg_mysql 为自增维护的触发器。Oracle 5.7.32 默认导出触发器时,在写出行数据后以状态码 2 退出,留下不完整文件。使用 --skip-triggers 后导出返回 0,建表 DDL 重建自增行为,恢复后首次新增行取得 ID 2。回放前务必检查导出退出码。含业务触发器的表应使用原生归档,或逐项转换、重建并验证业务触发器。下面的整 schema 用例保留了默认的触发器导出设置。
在新的目标实例安装扩展,并为属主创建空的 app schema。导出角色须能读取对象和视图定义,恢复角色须能创建对象及写入数据。转储经 MySQL 端口回放,以正确解析引号、可执行注释和会话变量。实测中,两种恢复路径都保住了二进制字节、生成值、视图及前缀主键。恢复后还验证了拒绝新增孤儿行、保留历史孤儿行、缺失父表后续绑定及级联删除。此次未在独立的 Oracle MySQL 服务器上恢复该转储。
检查加密表
使用 ENCRYPTION='Y' 前,预加载 pg_tde 与 pg_mysql,在目标 PostgreSQL 库中安装两者,并配置密钥提供方和主密钥。MySQL 子句据此选择表访问方法。回显的 ENGINE=InnoDB 是兼容写法,实际存储应查 PostgreSQL 表访问方法和加密标志。逻辑转储中含可读数据,备份文件需要单独保护。恢复目的端须先配置密钥,完成后检查实际加密状态。PG TDE 配置与密钥管理
在 mysql 中,表定义含 ENCRYPTION='Y',读回行为 7。在原生 psql -d postgres 中,以下查询分别返回 notes | heap | f、sealed | tde_heap | t、sealed_copy | tde_heap | t、sealed_pkey | btree | t。主键索引显示的是索引访问方法,要另外查看加密标志。
完整内核的双节点联测还通过 TDS 读回 MySQL 写入,通过 MySQL 读回 TDS 写入;两端的表和主键索引都已加密。显式指定 ENCRYPTION='N' 请求使用 heap,仍受数据库加密策略约束。应使用业务实际的密钥提供方演练恢复;上面的逻辑转储回放用例使用普通表。
切换与回退
- 在独立目标实例演练。核对行数、键范围、二进制
HEX、按目标排序规则产生的重复键、孤儿数、生成值、下一自增值、属主及应用授权。用业务驱动各做一次提交和回滚。 - 暂停源端写入,等在途事务结束,导出最终一致的数据并重新比对。MySQL GTID 复制不可用(
@@gtid_mode='OFF'、两个 GTID 集合均为空),PostgreSQL WAL 位置无法接续 MySQL GTID 流。 - 切换应用连接并保留源库和备份。目标尚无新写入时,可以将客户端切回源库。目标一旦有新提交,须先停写并对账迁回增量,再开放源端写入。
6 - 限制与排障
连接问题
| 现象 | 检查什么 | 处理 |
|---|---|---|
mysql 查找套接字文件,或报协议错误 | MySQL 监听仅支持 TCP;5432 通常使用 PostgreSQL 协议。 | 使用 --protocol=TCP -h 127.0.0.1 -P 3306,或按实际配置替换地址和端口。 |
| 配置变更后连接被拒 | 用 psql 查 SHOW shared_preload_libraries 和 pg_settings.pending_restart;在日志中找 MySQL protocol listening on port 或端口绑定告警。 | 更改预加载、地址或端口后重启。检查端口冲突、mysql.listener_on 及 mysql.port 是否为 0。 |
| 尚未执行 SQL 就登录失败 | 用 PostgreSQL 目标库名、角色、客户端 IP 和 TLS 模式核对首条匹配的 HBA 规则。检查角色的 LOGIN、口令有效期及验证器类型。 | 修正规则并重载 HBA,重新连接并校验证书。SHA-2 缓存未命中时使用 TLS,或使用已配置 RSA 交换的客户端。 |
| 普通角色被提示需要安装扩展 | 在 psql 查 SHOW mysql.database,再连接该库检查 pg_extension。 | 超级用户在目标库执行 CREATE EXTENSION pg_mysql,并为应用角色授予所需 schema 权限。 |
| 能登录但看不到表 | 对照 MySQL 的 SELECT DATABASE()、原生 SELECT current_database() 和表所在的 schema。 | MySQL 中使用 USE app;原生连接进入目标库并用 app.notes 等限定名访问。 |
| 找不到模块,或移除预加载项后实例拒绝启动 | 查对应安装的 pg_config --pkglibdir、预加载列表与启动日志。安装 MySQL 对象后,集群可在 mimus_required_features 中记录 mysql。 | 恢复配套内核、模块及预加载设置。若只想关闭端口,可设 mysql.listener_on=off 后重启,保留必需的回调。内核检查 |
结果不符或恢复失败
| 观察结果 | 检查与处理 |
|---|---|
| 大正整数 ID 报 1264、文本报 1366、日期或时间报 1292 | 对照源端值域、原始字节或时间值,回放前显式转换。类型示例 |
| 唯一键冲突或排序结果与源库不同 | DDL 后立即执行 SHOW WARNINGS,再执行 SHOW CREATE TABLE。核对有效排序规则、前缀与候选重复值。若是比较器版本警告,先盘点依赖的索引和分区键,再重建并校验。排序规则示例 |
| 关闭外键检查后仍报错 | 核对被引用键是否唯一,以及每张引用表的属主。重新开启检查也不会修复历史孤儿行。外键行为 |
| 转储文件已有行数据,但工具退出码非零 | 该转储不完整。检查生成列、触发器定义和客户端准确版本。Oracle 5.7.32 默认导出起步示例的自增表时返回 2。已演练的替代办法 |
pgcmp 安装时与 bit 到 bytea 的类型转换冲突 | 将 pgcmp 与 pg_mysql 安装在不同的 PostgreSQL 数据库中。 |
切换前需确认的边界
MySQL 方言存储过程、MySQL Unix 套接字、KILL [QUERY]、COM_CHANGE_USER 和 MySQL GTID 复制均不可用。依赖这些接口的应用需要先改造。一致性报表与排他维护还须考虑实测事务行为。
其他驱动及连接池重置策略、MySQL 8 专属元数据与语言排序细则、任意持久化 DDL、业务自定义触发器都需要应用级验证。握手版本、ORM 登录或一次查询成功均不足以覆盖这些路径。生产密钥提供方恢复、大量键共用同一前缀时的性能也需要按业务环境演练。驱动覆盖 · 恢复覆盖
7 - 协议、方言与来源
从 TCP 连接到数据表
300 补丁引入 OpenHalo 服务端钩子。预加载扩展在启动时注册 TCP 监听。建立连接时,PostgreSQL 后端进行 MySQL 握手,选择 mysql.database 对应的原生数据库并认证 PostgreSQL 角色。在接收业务 SQL 前,后端会确认该库中已安装扩展。客户端发送的数据库名在此库内选择 schema。300/301 内核补丁
解析与执行
扩展负责 MySQL 语法、支持的 DDL/DML 改写、兼容类型和函数,以及 MySQL 结果包编码;PostgreSQL 负责计划、执行与存储。301 补丁整合方言限定的类型转换、专用排序比较器、外键检查和启动依赖。原生客户端使用 PostgreSQL 协议和解析器访问同一套目录。两种入口的 SQL 行为
原生库中的名称
示例 MySQL 数据库 app 映射为 schema app。扩展还安装自己的 schema:mysql 存放兼容对象,mys_informa_schema 提供 information_schema 兼容层,另外还有 performance_schema 与 mys_sys。迁移时单独导出业务对象,由目标扩展安装过程创建扩展成员。
识别本版构建
| 组件 | 19.0.1-r4 对应身份 |
|---|---|
| 原生内核 | pgsty/mimus 提交 0d8a551aa121,树 07fbb73680de,已在 PostgreSQL REL_19_0 上整合九层内核补丁。 |
| OpenHalo 内核来源 | 300 的上游输入来自 pgsty/openhalo 的 a7e6d509db7f;301 承载 Mimus 适配。 |
| 独立扩展 | pgsty/pg_mysql 提交 1e631f9802c5,树 53dd9be3e87b。用配套内核的 pg_config 直接构建此提交。pg_extension.extversion 和 pg_get_loaded_modules() 均报告 1.0。 |
| MySQL 协议 | 握手、VERSION() 和 @@version 均返回 mysql.compat_version,默认 5.7.32-log。@@version_comment 返回 mimus。 |
来源与许可
语法、早期 SQL 定义和兼容例程源于易景科技(Halo Tech)的 PostgreSQL 14 项目。PGSTY 将其移植到 PostgreSQL 18/19,并从 OpenHalo 的 aux_mysql 提取独立扩展 pg_mysql,由 PGSTY PTE. LTD. 的冯若航维护。早期跨内核实验属于 OpenHalo 18 的移植历史。OpenHalo 源码 · 早期移植记录
独立扩展沿用 GPL-3.0-or-later,保留易景科技(Halo Tech Co., Ltd.)与 openHalo.org 的 2019–2026 原始版权声明,以及解析器作者 Jet C.X. ZHANG 的署名。源码另列 PGSTY PTE. LTD.(2026)、PostgreSQL Global Development Group(1996–2026)及加州大学董事会(1994)。源于 PostgreSQL 的部分和关键词工具保留 PostgreSQL License。完整声明随源码的 LICENSE、COPYRIGHT 和 3party-legal-notices 分发。易景科技原始版权声明
其他内核
本手册中的用例要求 Mimus 19.0.1 配套的服务端回调与模块。早期 IvorySQL、Babelfish 移植实验使用了其他内核和扩展身份。在本版 Mimus 上使用 SQL Server 协议时,应使用配套 Babelfish 扩展。SQL Server 手册 · 加密表访问方法