Spec-Zone .ru
спецификации, руководства, описания, API

10.1.10.6. The utf8mb3 "Character Set" (Alias forutf8)

In a future version of MySQL, it is possible that utf8 will become the 4-byte utf8, and that users who want to indicate 3-byte utf8 will have to say utf8mb3. To avoid some future problems which might occur with replication when master and slave servers have different MySQL versions, it is possible for users to specify utf8mb3 in CHARACTER SET clauses, and utf8mb3_collation_substring in COLLATE clauses, where collation_substring is bin, czech_ci, danish_ci, esperanto_ci, estonian_ci, and so forth. For example:

CREATE TABLE t (s1 CHAR(1) CHARACTER SET utf8mb3;SELECT * FROM t WHERE s1 COLLATE utf8mb3_general_ci = 'x';DECLARE x VARCHAR(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_danish_ci;SELECT CAST('a' AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci;

MySQL immediately converts instances of utf8mb3 in an alias to utf8, so in statements such as SHOW CREATE TABLE or SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLUMNS or SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS, users will see the true name, utf8 or utf8_collation_substring.

The utf8mb3 alias is valid only in CHARACTER SET clauses, and in certain other places. For example, these are legal:

mysqld --character-set-server=utf8mb3SET NAMES 'utf8mb3'; /* and other SET statements that have similar effect */SELECT _utf8mb3 'a';

There is no utf8mb3 alias to the corresponding utf8 collation for collation names that include a version number (for example, utf8_unicode_520_ci) to indicate the Unicode Collation Algorithm version on which the collation is based.