# 字符串与数值辅助函数

> 供子串查找、格式校验和取整使用。

---

LLMS 索引： [llms.txt](/zh/llms.txt)

---

供子串查找、格式校验和取整使用。

## C {#c}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-ceil-for-mysql-pg-catalog-text-6cf42e3d" href="#mysql-ceil-for-mysql-pg-catalog-text-6cf42e3d">`mysql.ceil_for_mysql(text) → bigint`</a> | 解析文本并向上取整。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/43-func-num.sql#L97-L100) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysm/strfuncs.c#L706-L736) |
| <a id="mysql-check-set-pg-catalog-text-pg-catalog-text-bf4d13cb" href="#mysql-check-set-pg-catalog-text-pg-catalog-text-bf4d13cb">`mysql.check_set(text, text) → boolean`</a> | 按 SET 定义校验输入值。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/42-func-str.sql#L1108-L1114) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysm/strfuncs.c#L162-L266) |

## F {#f}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-floor-for-mysql-pg-catalog-text-cd8649fe" href="#mysql-floor-for-mysql-pg-catalog-text-cd8649fe">`mysql.floor_for_mysql(text) → bigint`</a> | 解析文本并向下取整。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/43-func-num.sql#L102-L105) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysm/strfuncs.c#L739-L769) |

## I {#i}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-is-numeric-pg-catalog-text-1e25f994" href="#mysql-is-numeric-pg-catalog-text-1e25f994">`mysql.is_numeric(text) → boolean`</a> | 校验输入是否符合相应的数值格式。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/43-func-num.sql#L590-L598) |
| <a id="mysql-is-valid-binary-pg-catalog-text-49731578" href="#mysql-is-valid-binary-pg-catalog-text-49731578">`mysql.is_valid_binary(text) → boolean`</a> | 校验输入是否符合相应的数值格式。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/43-func-num.sql#L575-L578) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysm/strfuncs.c#L1443-L1462) |
| <a id="mysql-is-valid-hex-pg-catalog-text-e943f746" href="#mysql-is-valid-hex-pg-catalog-text-e943f746">`mysql.is_valid_hex(text) → boolean`</a> | 校验输入是否符合相应的数值格式。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/43-func-num.sql#L585-L588) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysm/strfuncs.c#L1465-L1484) |

## T {#t}

| 对象签名 | 用途 | 源码定义 |
|---|---|---|
| <a id="mysql-text-instr-pg-catalog-text-pg-catalog-text-ed5f06d7" href="#mysql-text-instr-pg-catalog-text-pg-catalog-text-ed5f06d7">`mysql.text_instr(text, text) → integer`</a> | 为 LOCATE 或 INSTR 查找子串位置。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/42-func-str.sql#L1000-L1006) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysm/strfuncs.c#L269-L278) |
| <a id="mysql-text-locate2-pg-catalog-text-pg-catalog-text-d1a1f5dd" href="#mysql-text-locate2-pg-catalog-text-pg-catalog-text-d1a1f5dd">`mysql.text_locate2(text, text) → integer`</a> | 为 LOCATE 或 INSTR 查找子串位置。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/42-func-str.sql#L410-L416) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysm/strfuncs.c#L314-L318) |
| <a id="mysql-text-locate3-pg-catalog-text-pg-catalog-text-bigint-f8a36c11" href="#mysql-text-locate3-pg-catalog-text-pg-catalog-text-bigint-f8a36c11">`mysql.text_locate3(text, text, bigint) → integer`</a> | 为 LOCATE 或 INSTR 查找子串位置。 | [SQL](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/sql/baseline/42-func-str.sql#L518-L523) · [C](https://github.com/pgsty/pg_mysql/blob/0d51adcf5151ca5c98bc61de84f287ec3b4fe4a3/src/mysm/strfuncs.c#L321-L325) |

---

反链：

- [函数](/zh/docs/mysql/reference/objects/functions/)
