summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2017-03-21 13:08:14 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-04-28 09:35:36 +0200
commit86ccc8949f27f69f7ad895d345561567512a223a (patch)
tree893ef980259a91d7d2717df363b34351c791118c
parent43427e26d78123e66652741d960c14cf40342715 (diff)
downloadnextcloud-server-86ccc8949f27f69f7ad895d345561567512a223a.tar.gz
nextcloud-server-86ccc8949f27f69f7ad895d345561567512a223a.zip
MySQL 4 byte is now detected during setup in any case.
config.sample.php was updated to explicitly state that there detection in place to set mysql.utf8mb4
-rw-r--r--config/config.sample.php8
-rw-r--r--lib/private/Setup/MySQL.php10
2 files changed, 10 insertions, 8 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 363bdabef0f..69567f0bce7 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -1234,8 +1234,12 @@ $CONFIG = array(
'sqlite.journal_mode' => 'DELETE',
/**
- * If this setting is set to true MySQL can handle 4 byte characters instead of
- * 3 byte characters
+ * If requirements are met (see below) this setting is set to true during setup
+ * and MySQL can handle 4 byte characters instead of 3 byte characters.
+ *
+ * If you want to convert a 3-byte setup into a 4-byte setup please run the
+ * migration command:
+ * ./occ db:convert-mysql-charset
*
* MySQL requires a special setup for longer indexes (> 767 bytes) which are
* needed:
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
index 3f3ad6d9589..8290d675500 100644
--- a/lib/private/Setup/MySQL.php
+++ b/lib/private/Setup/MySQL.php
@@ -38,12 +38,10 @@ class MySQL extends AbstractDatabase {
$connection = $this->connect(['dbname' => null]);
// detect mb4
- if (is_null($this->config->getValue('mysql.utf8mb4', null))) {
- $tools = new MySqlTools();
- if ($tools->supports4ByteCharset($connection)) {
- $this->config->setValue('mysql.utf8mb4', true);
- $connection = $this->connect();
- }
+ $tools = new MySqlTools();
+ if ($tools->supports4ByteCharset($connection)) {
+ $this->config->setValue('mysql.utf8mb4', true);
+ $connection = $this->connect();
}
$this->createSpecificUser($username, $connection);