Overview
Displays the comparison method information for each character set.
Columns
Field |
Type |
Nullable |
|
|---|---|---|---|
| COLLATION_NAME | varchar(128) | NO | Comparison Method Name |
| CHARACTER_SET_NAME | varchar(128) | NO | Character set name associated with collation |
| ID | bigint(20) | NO | The ID of the collation. |
| IS_DEFAULT | varchar(4) | NO | Whether the collation is the default comparison method for the corresponding character set. |
| IS_COMPILED | varchar(4) | NO | Whether the character set is compiled into the server |
| SORTLEN | bigint(20) | NO | The size of memory required for the collation character set, in bytes |
Sample query
View the comparison method information for each character set, displaying the first 10 records.
obclient [oceanbase]> SELECT * FROM information_schema.COLLATIONS LIMIT 10;
The query result is as follows:
+--------------------+--------------------+------+------------+-------------+---------+
| COLLATION_NAME | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN |
+--------------------+--------------------+------+------------+-------------+---------+
| utf8mb4_general_ci | utf8mb4 | 45 | Yes | Yes | 1 |
| utf8mb4_bin | utf8mb4 | 46 | | Yes | 1 |
| binary | binary | 63 | Yes | Yes | 1 |
| gbk_chinese_ci | gbk | 28 | Yes | Yes | 1 |
| gbk_bin | gbk | 87 | | Yes | 1 |
| utf16_general_ci | utf16 | 54 | Yes | Yes | 1 |
| utf16_bin | utf16 | 55 | | Yes | 1 |
| gb18030_chinese_ci | gb18030 | 248 | Yes | Yes | 2 |
| gb18030_bin | gb18030 | 249 | | Yes | 1 |
| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 |
+--------------------+--------------------+------+------------+-------------+---------+
10 rows in set