aboutsummaryrefslogtreecommitdiff
path: root/sql/mysql.sql
diff options
context:
space:
mode:
authorPablo Polvorin <pablo.polvorin@process-one.net>2013-11-13 14:30:29 -0300
committerChristophe Romain <christophe.romain@process-one.net>2015-12-11 16:07:39 +0100
commitaaa718741ec999e4bb2b09d1576d92afff29c0cf (patch)
tree267d471a9fa15cfa1c328fe1096c1866aec4d034 /sql/mysql.sql
parentRemove undefined macro injected in 3bdd5d0d (diff)
Use BLOB instead of TEXT on mysql in stanza storage
Mysql 'utf8' do not support 4-bytes UTF8 chars. Characters like 'KISS MARK' (U+1F48B) causes mysql to cut the string at that point. There is utf8mb4 encoding available on newer mysql versions that do support 4-bytes utf8. But for storing stanzas, that doesn't need to be indexed or searched or inspected in any way, it was easier to use BLOB (the bytes stored are utf8 encoded anyway, like all XMPP), and avoids the need to redefine indexes (as allowed size is shorter on utf8mb4) or having mixed utf8 and utf8mb4 encodings on the same table.
Diffstat (limited to '')
-rw-r--r--sql/mysql.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/mysql.sql b/sql/mysql.sql
index 21e7b9b52..eaa107788 100644
--- a/sql/mysql.sql
+++ b/sql/mysql.sql
@@ -77,7 +77,7 @@ CREATE INDEX i_sr_user_grp ON sr_user(grp);
CREATE TABLE spool (
username varchar(250) NOT NULL,
- xml text NOT NULL,
+ xml BLOB NOT NULL,
seq BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARACTER SET utf8;