Information Schema COLLATIONS Table

You are viewing an old version of this article. View the current version here.

The Information Schema COLLATIONS table contains a list of supported collations.

It contains the following columns:

ColumnDescription
COLLATION_NAMEName of the collation.
CHARACTER_SET_NAMEAssociated character set.
IDCollation id.
IS_DEFAULTWhether the collation is the character set's default.
IS_COMPILEDWhether the collation is compiled into the server.
SORTLENSort length, used for determining the memory used to sort strings in this collation.

The SHOW COLLATION statement returns the same results and both can be reduced in a similar way. For example, the following two statements return the same results:

SHOW COLLATION WHERE Charset LIKE 'utf8';

and

SELECT * FROM information_schema.COLLATIONS 
WHERE CHARACTER_SET_NAME LIKE 'utf8';

NO PAD collations

MariaDB starting with 10.2

NO PAD collations regard trailing spaces as normal characters. You can get a list of all NO PAD collations as follows:

SELECT collation_name FROM information_schema.COLLATIONS
WHERE collation_name LIKE "%nopad%";  
+------------------------------+
| collation_name               |
+------------------------------+
| big5_chinese_nopad_ci        |
| big5_nopad_bin               |
...

See Setting Character Sets and Collations for details on specifying the character set at the server, database, table and column levels, and Supported Character Sets and Collations for a full list of supported characters sets and collations.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.