Skip to content

Commit ba7ca3b

Browse files
authored
Update pad attribute where needed (#20823) (#20910)
1 parent 6786a70 commit ba7ca3b

File tree

3 files changed

+36
-36
lines changed

3 files changed

+36
-36
lines changed

character-set-and-collation.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ SELECT
7676

7777
### Character set and collation naming
7878

79-
A character set can have multiple collations, named in the `<character_set>_<collation_properties>` format. For example, the `utf8mb4` character set has a collation called `utf8mb4_bin`, which is a binary collation for `utf8mb4`. Multiple collation properties can be included in the name, separated by underscores (`_`).
79+
A character set can have multiple collations, named in the `<character_set>_<collation_properties>` format. For example, the `utf8mb4` character set has a collation called `utf8mb4_bin`, which is a binary collation for `utf8mb4`. Multiple collation properties can be included in the name, separated by underscores (`_`).
8080

8181
The following table shows the common collation properties and meanings.
8282

@@ -158,16 +158,16 @@ SHOW COLLATION WHERE Charset = 'utf8mb4';
158158
```
159159

160160
```sql
161-
+--------------------+---------+------+---------+----------+---------+
162-
| Collation | Charset | Id | Default | Compiled | Sortlen |
163-
+--------------------+---------+------+---------+----------+---------+
164-
| utf8mb4_0900_ai_ci | utf8mb4 | 255 | | Yes | 1 |
165-
| utf8mb4_0900_bin | utf8mb4 | 309 | | Yes | 1 |
166-
| utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 |
167-
| utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 |
168-
| utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 1 |
169-
+--------------------+---------+------+---------+----------+---------+
170-
5 rows in set (0.00 sec)
161+
+--------------------+---------+-----+---------+----------+---------+---------------+
162+
| Collation | Charset | Id | Default | Compiled | Sortlen | Pad_attribute |
163+
+--------------------+---------+-----+---------+----------+---------+---------------+
164+
| utf8mb4_0900_ai_ci | utf8mb4 | 255 | | Yes | 0 | NO PAD |
165+
| utf8mb4_0900_bin | utf8mb4 | 309 | | Yes | 1 | NO PAD |
166+
| utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 | PAD SPACE |
167+
| utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 | PAD SPACE |
168+
| utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 8 | PAD SPACE |
169+
+--------------------+---------+-----+---------+----------+---------+---------------+
170+
5 rows in set (0.001 sec)
171171
```
172172

173173
For details about the TiDB support of the GBK character set, see [GBK](/character-set-gbk.md).

information-schema/information-schema-collations.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ summary: Learn the `COLLATIONS` information_schema table.
77

88
The `COLLATIONS` table provides a list of collations that correspond to character sets in the `CHARACTER_SETS` table. Currently, this table is included only for compatibility with MySQL.
99

10-
{{< copyable "sql" >}}
11-
1210
```sql
1311
USE information_schema;
1412
DESC collations;
@@ -20,29 +18,30 @@ DESC collations;
2018
+--------------------+-------------+------+------+---------+-------+
2119
| COLLATION_NAME | varchar(32) | YES | | NULL | |
2220
| CHARACTER_SET_NAME | varchar(32) | YES | | NULL | |
23-
| ID | bigint(11) | YES | | NULL | |
21+
| ID | bigint | YES | | NULL | |
2422
| IS_DEFAULT | varchar(3) | YES | | NULL | |
2523
| IS_COMPILED | varchar(3) | YES | | NULL | |
26-
| SORTLEN | bigint(3) | YES | | NULL | |
24+
| SORTLEN | bigint | YES | | NULL | |
25+
| PAD_ATTRIBUTE | varchar(9) | YES | | NULL | |
2726
+--------------------+-------------+------+------+---------+-------+
28-
6 rows in set (0.00 sec)
27+
7 rows in set (0.001 sec)
2928
```
3029

31-
{{< copyable "sql" >}}
32-
3330
```sql
3431
SELECT * FROM collations WHERE character_set_name='utf8mb4';
3532
```
3633

3734
```sql
38-
+--------------------+--------------------+------+------------+-------------+---------+
39-
| COLLATION_NAME | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN |
40-
+--------------------+--------------------+------+------------+-------------+---------+
41-
| utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 |
42-
| utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 |
43-
| utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 1 |
44-
+--------------------+--------------------+------+------------+-------------+---------+
45-
3 rows in set (0.001 sec)
35+
+--------------------+--------------------+------+------------+-------------+---------+---------------+
36+
| COLLATION_NAME | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN | PAD_ATTRIBUTE |
37+
+--------------------+--------------------+------+------------+-------------+---------+---------------+
38+
| utf8mb4_0900_ai_ci | utf8mb4 | 255 | | Yes | 0 | NO PAD |
39+
| utf8mb4_0900_bin | utf8mb4 | 309 | | Yes | 1 | NO PAD |
40+
| utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 | PAD SPACE |
41+
| utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 | PAD SPACE |
42+
| utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 8 | PAD SPACE |
43+
+--------------------+--------------------+------+------------+-------------+---------+---------------+
44+
5 rows in set (0.001 sec)
4645
```
4746

4847
The description of columns in the `COLLATIONS` table is as follows:
@@ -53,6 +52,7 @@ The description of columns in the `COLLATIONS` table is as follows:
5352
* `IS_DEFAULT`: Whether this collation is the default collation of the character set it belongs to.
5453
* `IS_COMPILED`: Whether the character set is compiled into the server.
5554
* `SORTLEN`: The minimum length of memory allocated when the collation sorts characters.
55+
* `PAD_ATTRIBUTE`: Whether trailing spaces are ignored during string comparison. `PAD SPACE` means that trailing spaces are ignored (for example, `'abc'` equals `'abc '`), while `NO PAD` means that trailing spaces are significant (for example, `'abc'` does not equal `'abc '`).
5656

5757
## See also
5858

sql-statements/sql-statement-show-collation.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ SHOW COLLATION WHERE Charset="utf8mb4";
8686
```
8787

8888
```sql
89-
+--------------------+---------+-----+---------+----------+---------+
90-
| Collation | Charset | Id | Default | Compiled | Sortlen |
91-
+--------------------+---------+-----+---------+----------+---------+
92-
| utf8mb4_0900_ai_ci | utf8mb4 | 255 | | Yes | 1 |
93-
| utf8mb4_0900_bin | utf8mb4 | 309 | | Yes | 1 |
94-
| utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 |
95-
| utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 |
96-
| utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 1 |
97-
+--------------------+---------+-----+---------+----------+---------+
98-
5 rows in set (0.00 sec)
89+
+--------------------+---------+-----+---------+----------+---------+---------------+
90+
| Collation | Charset | Id | Default | Compiled | Sortlen | Pad_attribute |
91+
+--------------------+---------+-----+---------+----------+---------+---------------+
92+
| utf8mb4_0900_ai_ci | utf8mb4 | 255 | | Yes | 0 | NO PAD |
93+
| utf8mb4_0900_bin | utf8mb4 | 309 | | Yes | 1 | NO PAD |
94+
| utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 | PAD SPACE |
95+
| utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 | PAD SPACE |
96+
| utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 8 | PAD SPACE |
97+
+--------------------+---------+-----+---------+----------+---------+---------------+
98+
5 rows in set (0.001 sec)
9999
```
100100

101101
## MySQL compatibility

0 commit comments

Comments
 (0)