Skip to content

Commit 99135fe

Browse files
authored
functions-and-operators: remove MySQL Reference Manual links (#21083)
1 parent 869591c commit 99135fe

11 files changed

+129
-127
lines changed

functions-and-operators/bit-functions-and-operators.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ TiDB 支持使用 MySQL 8.0 中提供的所有[位函数和操作符](https://de
2020
| [`<<`](#左移) | 左移 |
2121
| [`>>`](#右移) | 右移 |
2222

23-
## [`BIT_COUNT()`](https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#function_bit-count)
23+
## `BIT_COUNT()`
2424

2525
`BIT_COUNT(expr)` 函数返回 `expr` 中为 1 的位数。
2626

@@ -71,7 +71,7 @@ SELECT BIT_COUNT(INET_ATON('255.255.255.0'));
7171
1 row in set (0.00 sec)
7272
```
7373

74-
## [`&`(按位与)](https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#operator_bitwise-and)
74+
## `&`(按位与)
7575

7676
`&` 操作符用于执行按位与 (bitwise AND) 操作。它会比较两个数中的对应位,如果两个对应位都是 1,则结果中的对应位为 1,否则为 0。
7777

@@ -129,7 +129,7 @@ SELECT INET_NTOA(INET_ATON('192.168.1.2') & INET_ATON('255.255.255.0'));
129129
1 row in set (0.00 sec)
130130
```
131131

132-
## [`~`(按位取反)](https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#operator_bitwise-invert)
132+
## `~`(按位取反)
133133

134134
`~` 操作符用于对给定的值进行按位取反(bitwise NOT)操作。它会对给定值中的每一位进行取反:0 的位变为 1,1 的位变为 0。
135135

@@ -169,7 +169,7 @@ SELECT CONV(~ b'1111111111111111111111111111111111111111111111110000111100001111
169169
1 row in set (0.00 sec)
170170
```
171171

172-
## [`|`(按位或)](https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#operator_bitwise-or)
172+
## `|`(按位或)
173173

174174
`|` 操作符用于执行按位或 (bitwise OR) 操作。它会比较两个数中的对应位,如果至少有一个对应位为 1,则结果中的对应位为 1。
175175

@@ -197,7 +197,7 @@ SELECT CONV(b'1010' | b'1100',10,2);
197197
1 row in set (0.00 sec)
198198
```
199199

200-
## [`^`(按位异或)](https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#operator_bitwise-xor)
200+
## `^`(按位异或)
201201

202202
`^` 操作符用于执行按位异或 (bitwise XOR) 操作。它会比较两个数中的对应位,如果对应位不同,则结果中的对应位为 1。
203203

@@ -227,7 +227,7 @@ SELECT CONV(b'1010' ^ b'1100',10,2);
227227

228228
需要注意的是,由于省略了前导零,结果会显示为 `110` 而不是 `0110`
229229

230-
## [`<<`(左移)](https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#operator_left-shift)
230+
## `<<`(左移)
231231

232232
`<<` 操作符用于执行左移操作。它会将一个数中的所有位向左移动指定的位数,并用零填充右侧空出的位。
233233

@@ -261,7 +261,7 @@ SELECT n,1<<n,LPAD(CONV(1<<n,10,2),11,0) FROM cte;
261261
11 rows in set (0.00 sec)
262262
```
263263

264-
## [`>>`(右移)](https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#operator_right-shift)
264+
## `>>`(右移)
265265

266266
`>>` 操作符用于执行右移操作。它会将数中的所有位向右移动指定的位数,并用零填充左侧空出的位。
267267

functions-and-operators/encryption-and-compression-functions.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ TiDB 支持使用 MySQL 8.0 中提供的大部分[加密和压缩函数](https:/
2626
| [`UNCOMPRESSED_LENGTH()`](#uncompressed_length) | 返回字符串压缩前的长度 |
2727
| [`VALIDATE_PASSWORD_STRENGTH()`](#validate_password_strength) | 计算密码强度 |
2828

29-
### [`AES_DECRYPT()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_aes-decrypt)
29+
### `AES_DECRYPT()`
3030

3131
`AES_DECRYPT(data, key [,iv])` 函数使用相同的 `key` 解密之前由 [`AES_ENCRYPT()`](#aes_encrypt) 函数加密的 `data`
3232

@@ -47,7 +47,7 @@ SELECT AES_DECRYPT(0x28409970815CD536428876175F1A4923, 'secret');
4747
1 row in set (0.00 sec)
4848
```
4949

50-
### [`AES_ENCRYPT()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_aes-encrypt)
50+
### `AES_ENCRYPT()`
5151

5252
`AES_ENCRYPT(data, key [,iv])` 函数使用[高级加密标准 (AES)](https://zh.wikipedia.org/wiki/高级加密标准) 算法和 `key` 加密 `data`
5353

@@ -68,7 +68,7 @@ SELECT AES_ENCRYPT(0x616263,'secret');
6868
1 row in set (0.00 sec)
6969
```
7070

71-
### [`COMPRESS()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_compress)
71+
### `COMPRESS()`
7272

7373
`COMPRESS(expr)` 函数返回输入参数 `expr` 的压缩版本。
7474

@@ -122,7 +122,7 @@ SELECT LENGTH(a),LENGTH(COMPRESS(a)) FROM x;
122122
1 row in set (0.00 sec)
123123
```
124124

125-
### [`MD5()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_md5)
125+
### `MD5()`
126126

127127
`MD5(expr)` 函数为给定参数 `expr` 计算 128 位 [MD5](https://zh.wikipedia.org/wiki/MD5) 哈希值。
128128

@@ -139,7 +139,7 @@ SELECT MD5('abc');
139139
1 row in set (0.00 sec)
140140
```
141141

142-
### [`PASSWORD()`](https://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html#function_password)
142+
### `PASSWORD()`
143143

144144
> **警告:**
145145
>
@@ -162,7 +162,7 @@ SELECT PASSWORD('secret');
162162
Warning (Code 1681): PASSWORD is deprecated and will be removed in a future release.
163163
```
164164

165-
### [`RANDOM_BYTES()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_random-bytes)
165+
### `RANDOM_BYTES()`
166166

167167
`RANDOM_BYTES(n)` 函数返回 `n` 个随机字节。
168168

@@ -179,11 +179,11 @@ SELECT RANDOM_BYTES(3);
179179
1 row in set (0.00 sec)
180180
```
181181

182-
### [`SHA()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_sha1)
182+
### `SHA()`
183183

184184
`SHA()` 函数是 [`SHA1`](#sha1) 的别名。
185185

186-
### [`SHA1()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_sha1)
186+
### `SHA1()`
187187

188188
`SHA1(expr)` 函数为给定参数 `expr` 计算 160 位 [SHA-1](https://zh.wikipedia.org/wiki/SHA-1) 哈希值。
189189

@@ -200,7 +200,7 @@ SELECT SHA1('abc');
200200
1 row in set (0.00 sec)
201201
```
202202

203-
### [`SHA2()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_sha2)
203+
### `SHA2()`
204204

205205
`SHA2(str, n)` 函数使用 [SHA-2](https://zh.wikipedia.org/wiki/SHA-2) 系列中的算法计算哈希值。参数 `n` 用于选择算法。如果任一参数为 `NULL``n` 指定的算法未知或不受支持,`SHA2()` 返回 `NULL`
206206

@@ -248,7 +248,7 @@ SELECT SM3('abc');
248248
1 row in set (0.00 sec)
249249
```
250250

251-
### [`UNCOMPRESS()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_uncompress)
251+
### `UNCOMPRESS()`
252252

253253
`UNCOMPRESS(data)` 函数解压缩使用 [`COMPRESS()`](#compress) 函数压缩的数据。
254254

@@ -265,7 +265,7 @@ SELECT UNCOMPRESS(0x03000000789C72747206040000FFFF018D00C7);
265265
1 row in set (0.00 sec)
266266
```
267267

268-
### [`UNCOMPRESSED_LENGTH()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_uncompressed-length)
268+
### `UNCOMPRESSED_LENGTH()`
269269

270270
`UNCOMPRESSED_LENGTH(data)` 函数返回压缩数据的前 4 个字节,即字符串在使用 [`COMPRESS()`](#compress) 函数压缩之前的长度。
271271

@@ -282,7 +282,7 @@ SELECT UNCOMPRESSED_LENGTH(0x03000000789C72747206040000FFFF018D00C7);
282282
1 row in set (0.00 sec)
283283
```
284284

285-
### [`VALIDATE_PASSWORD_STRENGTH()`](https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_validate-password-strength)
285+
### `VALIDATE_PASSWORD_STRENGTH()`
286286

287287
`VALIDATE_PASSWORD_STRENGTH(str)` 函数用作 [TiDB 密码管理](/password-management.md)的一部分,它计算密码的强度并返回一个 0 到 100 之间的整数值。
288288

functions-and-operators/json-functions/json-functions-aggregate.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ summary: 了解聚合 JSON 值的 JSON 函数。
77

88
本文档介绍 TiDB [聚合函数](/functions-and-operators/aggregate-group-by-functions.md) 中专门用于处理 JSON 的聚合函数。
99

10-
## [JSON_ARRAYAGG()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-arrayagg)
10+
TiDB 支持使用 MySQL 8.0 中提供的[两个 JSON 聚合函数](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html)
11+
12+
## `JSON_ARRAYAGG()`
1113

1214
`JSON_ARRAYAGG(key)` 函数可以根据给定的 `key``key` 值聚合到一个 JSON 数组中。`key` 通常为表达式或列名。
1315

@@ -28,7 +30,7 @@ SELECT JSON_ARRAYAGG(v) FROM (SELECT 1 'v' UNION SELECT 2);
2830
1 row in set (0.00 sec)
2931
```
3032

31-
## [JSON_OBJECTAGG()](https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-objectagg)
33+
## `JSON_OBJECTAGG()`
3234

3335
`JSON_OBJECTAGG(key,value)` 函数可以根据给定的 `key``value``key` 值和 `value` 值聚合成一个 JSON 对象。`key``value` 通常为表达式或列名。
3436

functions-and-operators/json-functions/json-functions-create.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ summary: 了解创建 JSON 值的 JSON 函数。
55

66
# 创建 JSON 值的 JSON 函数
77

8-
本文档介绍用于创建 JSON 值的 JSON 函数。
8+
TiDB 支持使用 MySQL 8.0 中提供的所有[用于创建 JSON 值的 JSON 函数](https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html)
99

10-
## [JSON_ARRAY()](https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html#function_json-array)
10+
## `JSON_ARRAY()`
1111

1212
`JSON_ARRAY([val[, val] ...])` 函数接受一个值列表(可能为空)作为参数,并返回一个包含这些值的 JSON 数组。
1313

@@ -24,7 +24,7 @@ SELECT JSON_ARRAY(1,2,3,4,5), JSON_ARRAY("foo", "bar");
2424
1 row in set (0.00 sec)
2525
```
2626

27-
## [JSON_OBJECT()](https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html#function_json-object)
27+
## `JSON_OBJECT()`
2828

2929
`JSON_OBJECT([key,val[,key,val]...])` 函数接受一个键值对列表(可能为空)作为参数,并返回一个包含这些键值对的 JSON 对象。
3030

@@ -41,7 +41,7 @@ SELECT JSON_OBJECT("database", "TiDB", "distributed", TRUE);
4141
1 row in set (0.00 sec)
4242
```
4343

44-
## [JSON_QUOTE()](https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html#function_json-quote)
44+
## `JSON_QUOTE()`
4545

4646
`JSON_QUOTE(str)` 函数将字符串返回为带引号的 JSON 值。
4747

functions-and-operators/json-functions/json-functions-modify.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ summary: 了解修改 JSON 值的 JSON 函数。
55

66
# 修改 JSON 值的 JSON 函数
77

8-
本文档介绍用于修改 JSON 值的 JSON 函数。
8+
TiDB 支持使用 MySQL 8.0 中提供的所有[用于修改 JSON 值的 JSON 函数](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html)
99

10-
## [JSON_APPEND()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-append)
10+
## `JSON_APPEND()`
1111

1212
该函数为 [`JSON_ARRAY_APPEND()`](#json_array_append) 的别名。
1313

14-
## [JSON_ARRAY_APPEND()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-array-append)
14+
## `JSON_ARRAY_APPEND()`
1515

1616
`JSON_ARRAY_APPEND(json_array, path, value [,path, value] ...)` 函数将 `value` 插入 `path` 中指定的 `json_array` 数组的末尾,并返回结果。
1717

@@ -49,7 +49,7 @@ SELECT JSON_ARRAY_APPEND('{"transport_options": ["Car", "Boat", "Train"]}', '$.t
4949
1 row in set (0.00 sec)
5050
```
5151

52-
## [JSON_ARRAY_INSERT()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-array-insert)
52+
## `JSON_ARRAY_INSERT()`
5353

5454
`JSON_ARRAY_INSERT(json_array, path, value [,path, value] ...)` 函数将 `value` 插入 `path``json_array` 的指定位置,并返回结果。
5555

@@ -87,7 +87,7 @@ SELECT JSON_ARRAY_INSERT('["Car", "Boat", "Train"]', '$[1]', "Airplane") AS "Tra
8787
1 row in set (0.00 sec)
8888
```
8989

90-
## [JSON_INSERT()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-insert)
90+
## `JSON_INSERT()`
9191

9292
`JSON_INSERT(json_doc,path,value[,path,value] ...)` 函数将一个或多个值插入到 JSON 文档,并返回结果。
9393

@@ -125,7 +125,7 @@ SELECT JSON_INSERT('{"a": 61, "b": 62}', '$.a', 41, '$.c', 63);
125125
1 row in set (0.00 sec)
126126
```
127127

128-
## [JSON_MERGE_PATCH()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-merge-patch)
128+
## `JSON_MERGE_PATCH()`
129129

130130
`JSON_MERGE_PATCH(json_doc, json_doc [,json_doc] ...)` 将两个或多个 JSON 文档合并为一个 JSON 文档,但不保留重复键的值。如果其中某些 `json_doc` 参数包含重复的键,合并后的结果只保留后面指定的那个 `json_doc` 参数中的值。
131131

@@ -150,7 +150,7 @@ SELECT JSON_MERGE_PATCH(
150150
1 row in set (0.00 sec)
151151
```
152152

153-
## [JSON_MERGE_PRESERVE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-merge-preserve)
153+
## `JSON_MERGE_PRESERVE()`
154154

155155
`JSON_MERGE_PRESERVE(json_doc, json_doc [,json_doc] ...)` 函数通过保留所有键值的方式合并两个或多个 JSON 文档,并返回合并结果。
156156

@@ -171,15 +171,15 @@ SELECT JSON_MERGE_PRESERVE('{"a": 1, "b": 2}','{"a": 100}', '{"c": 300}');
171171
1 row in set (0.00 sec)
172172
```
173173

174-
## [JSON_MERGE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-merge)
174+
## `JSON_MERGE()`
175175

176176
> **警告:**
177177
>
178178
> 该函数已废弃。
179179
180180
该函数为 [`JSON_MERGE_PRESERVE()`](#json_merge_preserve) 已废弃的别名。
181181

182-
## [JSON_REMOVE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-remove)
182+
## `JSON_REMOVE()`
183183

184184
`JSON_REMOVE(json_doc,path [,path] ...)` 函数从 JSON 文档中删除指定 `path` 的数据并返回结果。
185185

@@ -215,7 +215,7 @@ SELECT JSON_REMOVE('{"a": 61, "b": 62, "c": 63}','$.b','$.c');
215215
1 row in set (0.00 sec)
216216
```
217217

218-
## [JSON_REPLACE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-replace)
218+
## `JSON_REPLACE()`
219219

220220
`JSON_REPLACE(json_doc,path,value[,path,value]...)` 函数替换 JSON 文档中的现有的值并返回结果。如果指定的路径不存在,该路径对应的值不会添加到结果中。
221221

@@ -253,7 +253,7 @@ SELECT JSON_REPLACE('{"a": 41, "b": 62}','$.b',42,'$.c',43);
253253
1 row in set (0.00 sec)
254254
```
255255

256-
## [JSON_SET()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-set)
256+
## `JSON_SET()`
257257

258258
`JSON_SET(json_doc,path,value[,path,value] ...)` 函数在 JSON 文档中插入或更新数据,并返回结果。
259259

@@ -291,7 +291,7 @@ SELECT JSON_SET('{"version": 1.1, "name": "example"}','$.version',1.2,'$.branch'
291291
1 row in set (0.00 sec)
292292
```
293293

294-
## [JSON_UNQUOTE()](https://dev.mysql.com/doc/refman/8.0/en/json-modification-functions.html#function_json-unquote)
294+
## `JSON_UNQUOTE()`
295295

296296
`JSON_UNQUOTE(json)` 函数去掉 JSON 值的引号,并以字符串形式返回结果。该函数与 [`JSON_QUOTE()`](/functions-and-operators/json-functions/json-functions-create.md#json_quote) 函数作用相反。
297297

functions-and-operators/json-functions/json-functions-return.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ summary: 了解返回 JSON 值的 JSON 函数。
55

66
# 返回 JSON 值的 JSON 函数
77

8-
本文介绍返回 JSON 值的 JSON 函数。
8+
TiDB 支持使用 MySQL 8.0 中提供的所有[用于返回 JSON 值属性的 JSON 函数](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html)
99

10-
## [JSON_DEPTH()](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-depth)
10+
## `JSON_DEPTH()`
1111

1212
`JSON_DEPTH(json_doc)` 函数返回 JSON 文档的最大深度。
1313

@@ -32,7 +32,7 @@ SELECT JSON_DEPTH('{"weather": {"current": "sunny"}}');
3232
1 row in set (0.00 sec)
3333
```
3434

35-
## [JSON_LENGTH()](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-length)
35+
## `JSON_LENGTH()`
3636

3737
`JSON_LENGTH(json_doc [,path])` 函数返回 JSON 文档的长度。如果指定了 `path` 参数,则返回路径中的值的长度。
3838

@@ -68,7 +68,7 @@ SELECT JSON_LENGTH('{"weather": {"current": "sunny", "tomorrow": "cloudy"}}','$.
6868
1 row in set (0.01 sec)
6969
```
7070

71-
## [JSON_TYPE()](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-type)
71+
## `JSON_TYPE()`
7272

7373
`JSON_TYPE(json_val)` 函数返回一个字符串,表示 [JSON 值的类型](/data-type-json.md#json-值的类型)
7474

@@ -132,7 +132,7 @@ SELECT JSON_TYPE('"2025-06-14"'),JSON_TYPE(CAST(CAST('2025-06-14' AS date) AS js
132132
1 row in set (0.00 sec)
133133
```
134134

135-
## [JSON_VALID()](https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-valid)
135+
## `JSON_VALID()`
136136

137137
`JSON_VALID(str)` 函数检查输入的参数是否为有效的 JSON 格式。该函数对于在将列转换为 `JSON` 类型之前进行检查非常有用。
138138

0 commit comments

Comments
 (0)