stable

Clone or download

Read-only

request #12299: Support multibyte characters on new instances 🎆 🦄

All new instances uses the utf8mb4 charset. Existing databases are not migrated as the operation is slow and can potentially be destructive. For this reason, we keep the existing tests making sure the table can be still be created with both the utf8 and utf8mb4 charset (it could also help detecting edge cases regarding the management of the charset between DB engines). It is mandatory that the DB server have the innodb_large_prefix option enabled. This option is the default in MySQL 5.7 and is the only possible choice in MySQL 8.0. Out of precaution, Mediawiki databases are for now left untouched. It is possible to manually convert an existing database with something like this (see [0]): ``` $ /opt/rh/rh-mysql57/root/usr/bin/mysqldump --skip-set-charset --no-data --databases <tuleap_db> > schema.sql $ /opt/rh/rh-mysql57/root/usr/bin/mysqldump --skip-set-charset -n -t --databases <tuleap_db> > data.sql $ sed 's/DEFAULT CHARACTER SET latin1/DEFAULT CHARACTER SET utf8mb4/g' schema.sql > schema_utf8mb4.sql $ sed -i 's/DEFAULT CHARSET=utf8/DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci /' schema_utf8mb4.sql $ sed -i 's/SET character_set_client = utf8/SET character_set_client = utf8mb4/' schema_utf8mb4.sql $ /opt/rh/rh-mysql57/root/usr/bin/mysql < schema_utf8mb4.sql $ /opt/rh/rh-mysql57/root/usr/bin/mysql < data.sql ``` [0] https://www.percona.com/blog/2018/04/10/migrating-database-charsets-to-utf8mb4/ Change-Id: I9b139ef79b3da904198fe2a6d99c064e75d99b12

Modified Files

Name
M Makefile +1 −1 Go to diff View file
M src/tuleap-cfg/Command/SetupMysqlInitCommand.php +1 −1 Go to diff View file
M tests/integration/tests/DAO/DBTablesDaoLoadKnowDataTest.php +4 −2 Go to diff View file
A tests/integration/tests/DAO/DBTablesDaoLoadKnowDataUTF8MB4Test.php +34 −0 Go to diff View file
A tests/integration/tests/DAO/DBTablesDaoLoadKnowDataUTF8Test.php +35 −0 Go to diff View file