Skip to content

Commit bd36eea

Browse files
authored
[Fix](doc) Fix the inaccurate behavior of some functions in the document (#3869)
## Versions - [x] dev - [x] 4.x - [ ] 3.x - [ ] 2.1 or older (not covered by version/language sync gate) ## Languages - [x] Chinese - [x] English - [ ] Japanese candidate translation needed ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built - [ ] Updated required version and language counterparts, or explained why not - [ ] If only one language changed, confirmed whether source/translation counterparts need sync
1 parent bde1977 commit bd36eea

36 files changed

Lines changed: 148 additions & 140 deletions

File tree

docs/sql-manual/sql-functions/aggregate-functions/count-by-enum.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Description: The return value is a JSON array string, and the order of internal
6767

6868
## Example
6969

70+
Because the order of JSON objects in the result is not stable, the result may be:
71+
7072
```sql
7173
CREATE TABLE count_by_enum_test(
7274
`id` varchar(1024) NULL,

docs/sql-manual/sql-functions/scalar-functions/array-functions/array.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ SELECT array(1, 2, 3, 4, 5);
6565
Create an array with elements of different types:
6666
```sql
6767
SELECT array(1, 'hello', 3.14, true);
68-
+----------------------------------+
69-
| array(1, 'hello', 3.14, true) |
70-
+----------------------------------+
71-
| ["1", "hello", "3.14", "true"] |
72-
+----------------------------------+
68+
+-------------------------------+
69+
| array(1, 'hello', 3.14, true) |
70+
+-------------------------------+
71+
| ["1", "hello", "3.14", "1"] |
72+
+-------------------------------+
7373
```
7474

7575
Create an empty array:

docs/sql-manual/sql-functions/scalar-functions/numeric-functions/signbit.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,35 @@ select signbit(-1.0);
5353
```
5454

5555
```text
56-
+-----------------------------+
57-
| signbit(cast(-1 as DOUBLE)) |
58-
+-----------------------------+
59-
| true |
60-
+-----------------------------+
56+
+---------------+
57+
| signbit(-1.0) |
58+
+---------------+
59+
| 1 |
60+
+---------------+
6161
```
6262

6363
```sql
6464
select signbit(0.0);
6565
```
6666

6767
```text
68-
+----------------------------+
69-
| signbit(cast(0 as DOUBLE)) |
70-
+----------------------------+
71-
| false |
72-
+----------------------------+
68+
+--------------+
69+
| signbit(0.0) |
70+
+--------------+
71+
| 0 |
72+
+--------------+
7373
```
7474

7575
```sql
7676
select signbit(1.0);
7777
```
7878

7979
```text
80-
+----------------------------+
81-
| signbit(cast(1 as DOUBLE)) |
82-
+----------------------------+
83-
| false |
84-
+----------------------------+
80+
+--------------+
81+
| signbit(1.0) |
82+
+--------------+
83+
| 0 |
84+
+--------------+
8585
```
8686

8787
```sql
@@ -92,6 +92,6 @@ select signbit(cast('+0.0' as double)) , signbit(cast('-0.0' as double));
9292
+---------------------------------+---------------------------------+
9393
| signbit(cast('+0.0' as double)) | signbit(cast('-0.0' as double)) |
9494
+---------------------------------+---------------------------------+
95-
| false | true |
95+
| 0 | 1 |
9696
+---------------------------------+---------------------------------+
9797
```

docs/sql-manual/sql-functions/scalar-functions/string-functions/ends-with.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ SELECT ENDS_WITH('test', 'test'), ENDS_WITH('testing', 'test');
9797
+---------------------------+------------------------------+
9898
| ENDS_WITH('test', 'test') | ENDS_WITH('testing', 'test') |
9999
+---------------------------+------------------------------+
100-
| 1 | 1 |
100+
| 1 | 0 |
101101
+---------------------------+------------------------------+
102102
```
103103

docs/sql-manual/sql-functions/scalar-functions/string-functions/mask-last-n.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ SELECT mask_last_n('ABC-123-xyz', 7);
144144

145145
10. UTF-8 character handling (masks by byte)
146146
```sql
147-
SELECT mask_last_n('Helloṭṛ123', 9);
147+
SELECT mask_last_n('Hello你好123', 9);
148148
```
149149
```text
150150
+--------------------------------+

docs/sql-manual/sql-functions/scalar-functions/string-functions/mask.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ SELECT mask('Test123', 'ABC', 'xyz', '999');
128128
+--------------------------------------+
129129
| mask('Test123', 'ABC', 'xyz', '999') |
130130
+--------------------------------------+
131-
| Xxxx999 |
131+
| Axxx999 |
132132
+--------------------------------------+
133133
```
134134

docs/sql-manual/sql-functions/scalar-functions/string-functions/position.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ SELECT POSITION('a', 'banana', 1), POSITION('a', 'banana', 3);
121121
SELECT POSITION('ḍḍumai' IN 'ṭṛì ḍḍumai hello'), POSITION('hello', 'ṭṛì ḍḍumai hello', 8);
122122
```
123123
```text
124-
+--------------------------------------+-------------------------------------------+
125-
| POSITION('ḍḍumai' IN 'ṭṛì ḍḍumai hello') | POSITION('hello', 'ṭṛì ḍḍumai hello', 8) |
126-
+--------------------------------------+-------------------------------------------+
127-
| 5 | 13 |
128-
+--------------------------------------+-------------------------------------------+
124+
+-------------------------------------------------------+---------------------------------------------------+
125+
| POSITION('ḍḍumai' IN 'ṭṛì ḍḍumai hello') | POSITION('hello', 'ṭṛì ḍḍumai hello', 8) |
126+
+-------------------------------------------------------+---------------------------------------------------+
127+
| 5 | 12 |
128+
+-------------------------------------------------------+---------------------------------------------------+
129129
```
130130

131131
8. Special character search

docs/sql-manual/sql-functions/scalar-functions/string-functions/reverse.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ SELECT REVERSE('12345'), REVERSE('!@#$%');
113113
SELECT REVERSE('ṭṛì ḍḍumai'), REVERSE('ḍḍumannàri');
114114
```
115115
```text
116-
+-----------------------+------------------------+
117-
| REVERSE('ṭṛì ḍḍumai') | REVERSE('ḍḍumannàri') |
118-
+-----------------------+------------------------+
119-
| iamuḍḍ ìṛṭ | irànnaumuḍḍ |
120-
+-----------------------+------------------------+
116+
+--------------------------------+----------------------------+
117+
| REVERSE('ṭṛì ḍḍumai') | REVERSE('ḍḍumannàri') |
118+
+--------------------------------+----------------------------+
119+
| iamuḍḍ ìṛṭ | irànnamuḍḍ |
120+
+--------------------------------+----------------------------+
121121
```
122122

123123
8. Mixed character types

docs/table-design/data-model/aggregate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ The computation in the table at this point is shown in the following figure:
168168

169169
![state-func-group-concat-state-result-2](/images/table-desigin/state-func-group-concat-state-result-2.png)
170170

171-
The query results are as follows:
171+
Because `group_concat` is order-sensitive, the result is unstable. The query results are as follows:
172172

173173
```sql
174174
mysql> SELECT sum(v1), group_concat_merge(v2) FROM aggstate;

i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/aggregate-functions/count-by-enum.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ COUNT_BY_ENUM(<expr1>, <expr2>, ... , <exprN>)
6666

6767
## 举例
6868

69+
由于结果中的 JSON 对象顺序可能不固定,下面结果可能为:
70+
6971
```sql
7072
CREATE TABLE count_by_enum_test(
7173
`id` varchar(1024) NULL,

0 commit comments

Comments
 (0)