Browse Source

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
tags/v12.0.0beta2
Thomas Müller 7 years ago
parent
commit
86ccc8949f
No account linked to committer's email address
2 changed files with 10 additions and 8 deletions
  1. 6
    2
      config/config.sample.php
  2. 4
    6
      lib/private/Setup/MySQL.php

+ 6
- 2
config/config.sample.php View File

@@ -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:

+ 4
- 6
lib/private/Setup/MySQL.php View File

@@ -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);

Loading…
Cancel
Save