Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 796464 - dev-db/mariadb: default config should use the utf8mb4 charset instead of utf8
Summary: dev-db/mariadb: default config should use the utf8mb4 charset instead of utf8
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-17 09:29 UTC by Hector Martin
Modified: 2021-06-29 12:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hector Martin 2021-06-17 09:29:40 UTC
The default server and client config files for dev-db/mariadb have the charset specified as utf8:

$ grep utf8 files/*
files/my.cnf.distro-client:loose-default-character-set=utf8
files/my.cnf.distro-server:character-set-server                         = utf8

It seems upstream changed the default to utf8mb4 at some point; at least 10.2 defaults to utf8 and 10.5 to utf8mb4 as far as I can tell.

This is a significant footgun: with these default overrides, and without further arguments, `mysqldump` will output silently broken backups for utf8mb4 databases (which are hopefully common these days, as this charset is needed to properly support emoji). Even if you change the server default, with the client config, you still get broken dumps. I just realized all my dumps have been silently eating emoji, and I even unknowingly restored one recently and just noticed the broken data.

I suggest these settings should be removed or changed to utf8mb4.

Reproducible: Always
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2021-06-17 11:59:15 UTC
No, upstream default is/was even latin1, see https://jira.mariadb.org/browse/MDEV-19123.

Next to upstream default, you also have to keep distro defaults in mind -- you just cannot change defaults easily. Maybe with 10.6 but previous versions will not change.
Comment 2 Hector Martin 2021-06-29 12:14:33 UTC
Removing the config options entirely on my Gentoo system yielded utf8mb4.