Skip to content

Commit 7eff42f

Browse files
morgongaut
authored andcommitted
Document character sets / collations (#628)
This was recently improved in pingcap/tidb#7647
1 parent 8b9ef8f commit 7eff42f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

sql/system-database.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,29 @@ To be compatible with MySQL, TiDB supports INFORMATION\_SCHEMA tables. Some thir
4242

4343
### CHARACTER\_SETS table
4444

45-
The CHARACTER\_SETS table provides information about character sets. But it contains dummy data. By default, TiDB only supports utf8mb4.
45+
The CHARACTER\_SETS table provides information about [character sets](character-set-support.md). The default character set in TiDB is `utf8`, which behaves similar to `utf8mb4` in MySQL. Additional character sets in this table are included for compatibility with MySQL:
4646

4747
```sql
48-
mysql> select * from CHARACTER_SETS;
49-
+--------------------|----------------------|-----------------------|--------+
50-
| CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN |
51-
+--------------------|----------------------|-----------------------|--------+
52-
| ascii | ascii_general_ci | US ASCII | 1 |
53-
| binary | binary | Binary pseudo charset | 1 |
54-
| latin1 | latin1_swedish_ci | cp1252 West European | 1 |
55-
| utf8 | utf8_general_ci | UTF-8 Unicode | 3 |
56-
| utf8mb4 | utf8mb4_general_ci | UTF-8 Unicode | 4 |
57-
+--------------------|----------------------|-----------------------|--------+
48+
mysql> SELECT * FROM character_sets;
49+
+--------------------+----------------------+---------------+--------+
50+
| CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN |
51+
+--------------------+----------------------+---------------+--------+
52+
| utf8 | utf8_bin | UTF-8 Unicode | 3 |
53+
| utf8mb4 | utf8mb4_bin | UTF-8 Unicode | 4 |
54+
| ascii | ascii_bin | US ASCII | 1 |
55+
| latin1 | latin1_bin | Latin1 | 1 |
56+
| binary | binary | binary | 1 |
57+
+--------------------+----------------------+---------------+--------+
5858
5 rows in set (0.00 sec)
5959
```
6060

6161
### COLLATIONS table
6262

63-
The COLLATIONS table is similar to the CHARACTER\_SETS table.
63+
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, as TiDB only supports binary collation.
6464

6565
### COLLATION\_CHARACTER\_SET\_APPLICABILITY table
6666

67-
NULL.
67+
This table maps collations to the applicable character set name. Similar to the collations table, it is included only for compatibility with MySQL.
6868

6969
### COLUMNS table
7070

0 commit comments

Comments
 (0)