kode54/quassel — pull request #1 by aziraphale (2014-02-16 11:53:59+00:00)
Title: MySQL `utf8mb4` support (high-end Unicode, e.g. emoji, support)

I've updated the DB and fixed the MySQL backend code to use MySQL's `utf8mb4` character set, thus allowing for UTF-8 characters encoded as 4 bytes to be stored (currently they'll actually cause the message to be **truncated** in the DB - they'll display fine until you reconnect, as Quassel sends the message to clients straight from its internal memory without going via the DB, but as soon as you reconnect you get the broken messages from the DB).

This adds a dependency on MySQL 5.5.3+, unfortunately, but I feel that truncated messages are a pretty serious bug that needed fixing urgently.

This also means that emoji can now be stored correctly in the DB :)

This pull request is a bit of a gigantic mess because my branch included me merging in the latest upstream code (version 0.9). Ideally only *my* commits would be included, so I'm happy to re-issue the pull request once you've merged in the 0.9 code, if you wish.

Also, to migrate an existing installation to use this code, you'll obviously have to run an `ALTER TABLE` statement on your DB to convert the `message` column in the `backlog` table to use the `utf8mb4` character set: `message TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin`. This will understandably take a while depending on your `backlog` table size and server speed - it took a minute or so for my table with ~130 million records.

I have this code successfully running on two cores so I'm quite confident in its stability :)