Commit f410190c authored by Vincent Petry's avatar Vincent Petry Committed by GitHub

Merge pull request #27441 from owncloud/fix-mb4-detection

MySQL 4 byte is now detected during setup in any case.
parents c7030634 a0049f13
......@@ -74,3 +74,7 @@ Options -Indexes
<IfModule pagespeed_module>
ModPagespeed Off
</IfModule>
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####
ErrorDocument 403 //core/templates/403.php
ErrorDocument 404 //core/templates/404.php
......@@ -1106,8 +1106,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:
......
......@@ -40,12 +40,10 @@ class MySQL extends AbstractDatabase {
$connection = $this->connect();
// detect mb4
if (is_null($this->config->getSystemValue('mysql.utf8mb4', null))) {
$tools = new MySqlTools();
if ($tools->supports4ByteCharset($connection)) {
$this->config->setSystemValue('mysql.utf8mb4', true);
$connection = $this->connect();
}
$tools = new MySqlTools();
if ($tools->supports4ByteCharset($connection)) {
$this->config->setSystemValue('mysql.utf8mb4', true);
$connection = $this->connect();
}
$this->createSpecificUser($username, $connection);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment