COLLATIONS

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.

  1. USE information_schema;
  2. DESC collations;
  1. +--------------------+-------------+------+------+---------+-------+
  2. | Field | Type | Null | Key | Default | Extra |
  3. +--------------------+-------------+------+------+---------+-------+
  4. | COLLATION_NAME | varchar(32) | YES | | NULL | |
  5. | CHARACTER_SET_NAME | varchar(32) | YES | | NULL | |
  6. | ID | bigint(11) | YES | | NULL | |
  7. | IS_DEFAULT | varchar(3) | YES | | NULL | |
  8. | IS_COMPILED | varchar(3) | YES | | NULL | |
  9. | SORTLEN | bigint(3) | YES | | NULL | |
  10. +--------------------+-------------+------+------+---------+-------+
  11. 6 rows in set (0.00 sec)
  1. SELECT * FROM collations WHERE character_set_name='utf8mb4';
  1. +--------------------+--------------------+------+------------+-------------+---------+
  2. | COLLATION_NAME | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN |
  3. +--------------------+--------------------+------+------------+-------------+---------+
  4. | utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 |
  5. | utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 |
  6. | utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 1 |
  7. +--------------------+--------------------+------+------------+-------------+---------+
  8. 3 rows in set (0.001 sec)

The description of columns in the COLLATIONS table is as follows:

  • COLLATION_NAME: The name of the collation.
  • CHARACTER_SET_NAME: The name of the character set which the collation belongs to.
  • ID: The ID of the collation.
  • IS_DEFAULT: Whether this collation is the default collation of the character set it belongs to.
  • IS_COMPILED: Whether the character set is compiled into the server.
  • SORTLEN: The minimum length of memory allocated when the collation sorts characters.

See also