Praqma / staci

Containerizing the Atlassian tools stack. Jira, Confluence, Bamboo and a MySQL database.
MIT License
12 stars 5 forks source link

MySQL DB's is created with wrong unicode encoding #77

Open TheLeftMoose opened 7 years ago

TheLeftMoose commented 7 years ago

It appears that the MySQL db's is created with plain UTF-8, which makes crucible throw an error when a user is inserting a UTF8MB4 charater (like 💩 which is ": poop :" without the spaces)

http://www.fileformat.info/info/unicode/char/1F4A9/index.htm

We have already made a ticket at Atlassian (see heading below) and got the answer that it is because of the wrong collation of UTF8 that was set on the DB. [SUPPORT] [Crucible Support] Som unicode sequences not supported in review comments [CRC-10760]

To correct this it is necessary that staci takes this into account and converts the DB scheme to UTF8mb4. see how to: https://mathiasbynens.be/notes/mysql-utf8mb4

The concern from our users was concretely that they couldn't communicate properly in the comments if it isn't possible to use characters within the UTF8mb4 collation.

\d

hoeghh commented 7 years ago

Hi,

Sorry, i didnt see your issue. I will look at this soon. Im super busy, but will see if i can find the time soon. You are more then welcome to do a pull request if possible.

hoeghh commented 7 years ago

I guess the line :

exec_sql $mysql_root_pass "CREATE DATABASE IF NOT EXISTS $crucible_database CHARACTER SET utf8 COLLATE utf8_bin;"

in staci/bin/init-mysql.sh (line 149) should be changed to :

exec_sql $mysql_root_pass "CREATE DATABASE IF NOT EXISTS $crucible_database CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

The my.cfg should be changed as well. But then this is for all databases. So we need to change them all, and do alot of testing.

It should have some of these properties :

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
hoeghh commented 7 years ago

links : https://mathiasbynens.be/notes/mysql-utf8mb4 https://support.helpspot.com/index.php?pg=kb.page&id=467