You are not logged in.

#1 Yesterday 20:57:42

vario
Member
Registered: 2017-12-24
Posts: 19

mariadb - collation for information/performance_schema & sys

I was hoping after upgrade to mariadb 13.2 I would see information_schema, performance_schema and sys databases with utf8mb4 collation since that has become the new default collation. They remain as utf8mb3 collation.

Is there a reason these haven't got the new default collation, and can I do anything to change them to utf8mb4?

Neil.

Offline

#2 Today 00:41:21

loqs
Member
Registered: 2014-03-06
Posts: 19,146

Re: mariadb - collation for information/performance_schema & sys

MariaDB does not store a flag indicating whether collation was inherited by default or explicitly assigned,  having no way to know if you set utf8mb3 or it is a default it leaves it as is for already created items but will use the new default for newly created items. Before doing either of the following make sure nothing relies on a specific collation. Run a global `ALTER TABLE .... 'CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'....WHERE....TABLE_COLLATION != 'utf8mb4_unicode_ci';` or export everything strip the specified collations from the export import into a new database.

Offline

#3 Today 06:03:43

vario
Member
Registered: 2017-12-24
Posts: 19

Re: mariadb - collation for information/performance_schema & sys

MariaDB [(none)]> show variables like 'collation%';
+----------------------+-----------------------+
| Variable_name        | Value                 |
+----------------------+-----------------------+
| collation_connection | utf8mb4_uca1400_ai_ci |
| collation_database   | utf8mb4_unicode_ci    |
| collation_server     | utf8mb4_unicode_ci    |
+----------------------+-----------------------+
3 rows in set (0.002 sec)

MariaDB [(none)]> show variables like 'character_set%';
+--------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name            | Value                                                                                                                                   |
+--------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| character_set_client     | utf8mb4                                                                                                                                 |
| character_set_collations | utf8mb3=utf8mb3_uca1400_ai_ci,ucs2=ucs2_uca1400_ai_ci,utf8mb4=utf8mb4_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci |
| character_set_connection | utf8mb4                                                                                                                                 |
| character_set_database   | utf8mb4                                                                                                                                 |
| character_set_filesystem | binary                                                                                                                                  |
| character_set_results    | utf8mb4                                                                                                                                 |
| character_set_server     | utf8mb4                                                                                                                                 |
| character_set_system     | utf8mb3                                                                                                                                 |
| character_sets_dir       | /usr/share/mysql/charsets/                                                                                                              |
+--------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
9 rows in set (0.001 sec)

Having set old_mode to empty string, I am left with character_set_system at utf8mb3 and I can't change that as its read-only, and I guess the one value that needs to be changed!

All my databases have utf8mb4 collation, but I have a few tables in one db with utf8mb3 collation, for an application that joins to the information_schema database and if I change these to utf8mb4 I get "illegal mix of collation" errors, and it is this that is the main reason for my frustration.

Neil

Offline

#4 Today 08:03:05

loqs
Member
Registered: 2014-03-06
Posts: 19,146

Re: mariadb - collation for information/performance_schema & sys

What does the following return:

SELECT VERSION(), @@character_set_system, @@old_mode;

Offline

#5 Today 09:14:11

vario
Member
Registered: 2017-12-24
Posts: 19

Re: mariadb - collation for information/performance_schema & sys

OK, I admit to misreading the pacman output... but the default character set is still utf8mb4 https://mariadb.com/docs/release-notes/ … 3.1/13.1.2

MariaDB [(none)]> SELECT VERSION(), @@character_set_system, @@old_mode;
+----------------+------------------------+------------+
| VERSION()      | @@character_set_system | @@old_mode |
+----------------+------------------------+------------+
| 13.1.2-MariaDB | utf8mb3                |            |
+----------------+------------------------+------------+
1 row in set (0.001 sec)

Neil.

Offline

Board footer

Powered by FluxBB