From 929e5faa4fcceaedb19f96284bf4c31bbd15c538 Mon Sep 17 00:00:00 2001 From: Evert Pot Date: Mon, 26 Oct 2015 22:33:05 -0400 Subject: [PATCH 1/3] Switched charset from all mysql tables to utf8mb4 --- examples/sql/mysql.addressbook.sql | 6 +++--- examples/sql/mysql.calendars.sql | 10 +++++----- examples/sql/mysql.locks.sql | 2 +- examples/sql/mysql.principals.sql | 4 ++-- examples/sql/mysql.propertystorage.sql | 3 ++- examples/sql/mysql.users.sql | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/examples/sql/mysql.addressbook.sql b/examples/sql/mysql.addressbook.sql index 5ec8428a7e..3d7e295ff9 100644 --- a/examples/sql/mysql.addressbook.sql +++ b/examples/sql/mysql.addressbook.sql @@ -6,7 +6,7 @@ CREATE TABLE addressbooks ( description TEXT, synctoken INT(11) UNSIGNED NOT NULL DEFAULT '1', UNIQUE(principaluri(100), uri(100)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; CREATE TABLE cards ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -16,7 +16,7 @@ CREATE TABLE cards ( lastmodified INT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; CREATE TABLE addressbookchanges ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -25,4 +25,4 @@ CREATE TABLE addressbookchanges ( addressbookid INT(11) UNSIGNED NOT NULL, operation TINYINT(1) NOT NULL, INDEX addressbookid_synctoken (addressbookid, synctoken) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; diff --git a/examples/sql/mysql.calendars.sql b/examples/sql/mysql.calendars.sql index 55d3b486ee..4ec6771959 100644 --- a/examples/sql/mysql.calendars.sql +++ b/examples/sql/mysql.calendars.sql @@ -11,7 +11,7 @@ CREATE TABLE calendarobjects ( lastoccurence INT(11) UNSIGNED, uid VARBINARY(200), UNIQUE(calendarid, uri) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; CREATE TABLE calendars ( id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -26,7 +26,7 @@ CREATE TABLE calendars ( components VARBINARY(20), transparent TINYINT(1) NOT NULL DEFAULT '0', UNIQUE(principaluri, uri) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; CREATE TABLE calendarchanges ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -35,7 +35,7 @@ CREATE TABLE calendarchanges ( calendarid INT(11) UNSIGNED NOT NULL, operation TINYINT(1) NOT NULL, INDEX calendarid_synctoken (calendarid, synctoken) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; CREATE TABLE calendarsubscriptions ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -51,7 +51,7 @@ CREATE TABLE calendarsubscriptions ( stripattachments TINYINT(1) NULL, lastmodified INT(11) UNSIGNED, UNIQUE(principaluri, uri) -); +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; CREATE TABLE schedulingobjects ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -61,4 +61,4 @@ CREATE TABLE schedulingobjects ( lastmodified INT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; diff --git a/examples/sql/mysql.locks.sql b/examples/sql/mysql.locks.sql index 6dda3db143..5170bae951 100644 --- a/examples/sql/mysql.locks.sql +++ b/examples/sql/mysql.locks.sql @@ -9,5 +9,5 @@ CREATE TABLE locks ( uri VARBINARY(1000), INDEX(token), INDEX(uri(100)) -); +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; diff --git a/examples/sql/mysql.principals.sql b/examples/sql/mysql.principals.sql index e23e40e907..af2a4b0326 100644 --- a/examples/sql/mysql.principals.sql +++ b/examples/sql/mysql.principals.sql @@ -4,14 +4,14 @@ CREATE TABLE principals ( email VARBINARY(80), displayname VARCHAR(80), UNIQUE(uri) -); +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; CREATE TABLE groupmembers ( id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, principal_id INTEGER UNSIGNED NOT NULL, member_id INTEGER UNSIGNED NOT NULL, UNIQUE(principal_id, member_id) -); +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; INSERT INTO principals (uri,email,displayname) VALUES diff --git a/examples/sql/mysql.propertystorage.sql b/examples/sql/mysql.propertystorage.sql index f0a21a111e..910bd5ddbf 100644 --- a/examples/sql/mysql.propertystorage.sql +++ b/examples/sql/mysql.propertystorage.sql @@ -4,5 +4,6 @@ CREATE TABLE propertystorage ( name VARBINARY(100) NOT NULL, valuetype INT UNSIGNED, value MEDIUMBLOB -); +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; + CREATE UNIQUE INDEX path_property ON propertystorage (path(600), name(100)); diff --git a/examples/sql/mysql.users.sql b/examples/sql/mysql.users.sql index ab67b47afb..73953951f9 100644 --- a/examples/sql/mysql.users.sql +++ b/examples/sql/mysql.users.sql @@ -3,7 +3,7 @@ CREATE TABLE users ( username VARBINARY(50), digesta1 VARBINARY(32), UNIQUE(username) -); +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; INSERT INTO users (username,digesta1) VALUES ('admin', '87fd274b7b6c01e48d7c2f965da8ddf7'); From f5acc14ab13ac16ca1f0120e3b71428ed5962d7b Mon Sep 17 00:00:00 2001 From: Evert Pot Date: Mon, 26 Oct 2015 22:34:43 -0400 Subject: [PATCH 2/3] Updated changelog, bumped version --- CHANGELOG.md | 7 +++++++ lib/DAV/Version.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b0211d855..f0861afcfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ ChangeLog ========= +3.0.6 (2015-??-??) +------------------ + +* Switched all mysql tables to `utf8mb4` character set, allowing you to use + emoji in some tables where you couldn't before. + + 3.0.5 (2015-09-15) ------------------ diff --git a/lib/DAV/Version.php b/lib/DAV/Version.php index 3ceeef37c2..4ca696449a 100644 --- a/lib/DAV/Version.php +++ b/lib/DAV/Version.php @@ -14,6 +14,6 @@ class Version { /** * Full version number */ - const VERSION = '3.0.5'; + const VERSION = '3.0.6'; } From 3676d97889fbfb6e4b2ed0ee781e88d067758f60 Mon Sep 17 00:00:00 2001 From: Evert Pot Date: Mon, 26 Oct 2015 22:47:53 -0400 Subject: [PATCH 3/3] let mysql pick the default collation --- examples/sql/mysql.addressbook.sql | 6 +++--- examples/sql/mysql.calendars.sql | 10 +++++----- examples/sql/mysql.locks.sql | 3 +-- examples/sql/mysql.principals.sql | 5 ++--- examples/sql/mysql.propertystorage.sql | 2 +- examples/sql/mysql.users.sql | 2 +- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/examples/sql/mysql.addressbook.sql b/examples/sql/mysql.addressbook.sql index 3d7e295ff9..9ec88babec 100644 --- a/examples/sql/mysql.addressbook.sql +++ b/examples/sql/mysql.addressbook.sql @@ -6,7 +6,7 @@ CREATE TABLE addressbooks ( description TEXT, synctoken INT(11) UNSIGNED NOT NULL DEFAULT '1', UNIQUE(principaluri(100), uri(100)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE cards ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -16,7 +16,7 @@ CREATE TABLE cards ( lastmodified INT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE addressbookchanges ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -25,4 +25,4 @@ CREATE TABLE addressbookchanges ( addressbookid INT(11) UNSIGNED NOT NULL, operation TINYINT(1) NOT NULL, INDEX addressbookid_synctoken (addressbookid, synctoken) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/examples/sql/mysql.calendars.sql b/examples/sql/mysql.calendars.sql index 4ec6771959..e3f5a01dc8 100644 --- a/examples/sql/mysql.calendars.sql +++ b/examples/sql/mysql.calendars.sql @@ -11,7 +11,7 @@ CREATE TABLE calendarobjects ( lastoccurence INT(11) UNSIGNED, uid VARBINARY(200), UNIQUE(calendarid, uri) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE calendars ( id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -26,7 +26,7 @@ CREATE TABLE calendars ( components VARBINARY(20), transparent TINYINT(1) NOT NULL DEFAULT '0', UNIQUE(principaluri, uri) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE calendarchanges ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -35,7 +35,7 @@ CREATE TABLE calendarchanges ( calendarid INT(11) UNSIGNED NOT NULL, operation TINYINT(1) NOT NULL, INDEX calendarid_synctoken (calendarid, synctoken) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE calendarsubscriptions ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -51,7 +51,7 @@ CREATE TABLE calendarsubscriptions ( stripattachments TINYINT(1) NULL, lastmodified INT(11) UNSIGNED, UNIQUE(principaluri, uri) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE schedulingobjects ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -61,4 +61,4 @@ CREATE TABLE schedulingobjects ( lastmodified INT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/examples/sql/mysql.locks.sql b/examples/sql/mysql.locks.sql index 5170bae951..96a3a88d95 100644 --- a/examples/sql/mysql.locks.sql +++ b/examples/sql/mysql.locks.sql @@ -9,5 +9,4 @@ CREATE TABLE locks ( uri VARBINARY(1000), INDEX(token), INDEX(uri(100)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; - +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/examples/sql/mysql.principals.sql b/examples/sql/mysql.principals.sql index af2a4b0326..ea0d16a273 100644 --- a/examples/sql/mysql.principals.sql +++ b/examples/sql/mysql.principals.sql @@ -4,15 +4,14 @@ CREATE TABLE principals ( email VARBINARY(80), displayname VARCHAR(80), UNIQUE(uri) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE groupmembers ( id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, principal_id INTEGER UNSIGNED NOT NULL, member_id INTEGER UNSIGNED NOT NULL, UNIQUE(principal_id, member_id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; - +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; INSERT INTO principals (uri,email,displayname) VALUES ('principals/admin', 'admin@example.org','Administrator'), diff --git a/examples/sql/mysql.propertystorage.sql b/examples/sql/mysql.propertystorage.sql index 910bd5ddbf..1b5ca5ac6e 100644 --- a/examples/sql/mysql.propertystorage.sql +++ b/examples/sql/mysql.propertystorage.sql @@ -4,6 +4,6 @@ CREATE TABLE propertystorage ( name VARBINARY(100) NOT NULL, valuetype INT UNSIGNED, value MEDIUMBLOB -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE UNIQUE INDEX path_property ON propertystorage (path(600), name(100)); diff --git a/examples/sql/mysql.users.sql b/examples/sql/mysql.users.sql index 73953951f9..22ac312d5b 100644 --- a/examples/sql/mysql.users.sql +++ b/examples/sql/mysql.users.sql @@ -3,7 +3,7 @@ CREATE TABLE users ( username VARBINARY(50), digesta1 VARBINARY(32), UNIQUE(username) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; INSERT INTO users (username,digesta1) VALUES ('admin', '87fd274b7b6c01e48d7c2f965da8ddf7');