Note
This view is introduced since OceanBase Database V1.4.
Purpose
This view displays the collation of each character set.
Columns
| Column | Type | Nullable? | |
|---|---|---|---|
| COLLATION_NAME | varchar(128) | NO | The name of the collation. |
| CHARACTER_SET_NAME | varchar(128) | NO | The name of the character set associated with the collation. |
| ID | bigint(20) | NO | The ID of the collation. |
| IS_DEFAULT | varchar(4) | NO | Indicates whether the collation is the default collation for its character set. |
| IS_COMPILED | varchar(4) | NO | Indicates whether the character set is compiled into the server. |
| SORTLEN | bigint(20) | NO | The size of memory required to sort strings expressed in the character set. |
Sample query
Query the collation information for each character set, and display 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