#80398Make default charset and collation for new tables configurable
Description
to be able to store 4 byte unicode characters we need to set database to utf8mb4. since typo3 8 there is a configuration parameter for that but it seems that it is not taken into account.
LocalConfiguration.php
'DB' => [
'Connections' => [
'Default' => [
'charset' => 'utf8mb4',
'dbname' => '--dbname--',
'driver' => 'mysqli',
'host' => '127.0.0.1',
'password' => '--mypassword--',
'port' => 3306,
'user' => '--myuser--',
],
],
],
create table statements do have a fallback but do not read from configuration
private function buildTableOptions(array $options)
{
if (isset($options['table_options'])) {
return $options['table_options'];
}
$tableOptions = array();
// Charset
if ( ! isset($options['charset'])) {
$options['charset'] = 'utf8';
}
....
}
DatabaseConnection class also does not read charset configuration either it takes utf8 as a default.
$connection = \Doctrine\DBAL\DriverManager::getConnection([
'driver' => 'mysqli',
'wrapperClass' => Connection::class,
'host' => $host,
'port' => (int)$this->databasePort,
'unix_socket' => $this->databaseSocket,
'user' => $this->databaseUsername,
'password' => $this->databaseUserPassword,
'charset' => $this->connectionCharset,
]);
it was stated that it would be fixed in CMS 8
https://forge.typo3.org/issues/71454
is this on roadmap? before LTS?
Reviews 5
- main 85670[TASK] Deprecate `tableoptions` and `collate` connection config
- main 85658[TASK] Mitigate deprecated Doctrine DBAL connection options
- 11.5 75213[BUGFIX] Transform `tableoptions` early to valid `doctrine/dbal` option
- main 75211[BUGFIX] Transform `tableoptions` early to valid `doctrine/dbal` option
- main 56440[FEATURE] Use utf8mb4 on mysql for new instances
Related issues 8
- Feature #71454Allow setting Connection Charset
- Feature #80659Set Charset to utf8mb4
- Bug #82080Indexes too large for some tables with utf8mb4
- Bug #82551Upgrade Wizard Deadlock
- Bug #86793Renamed columns are not correctly detected by database schema diff
- Bug #97961Transform `tableoptions` early to valid `doctrine/dbal` option
- Task #105289Mitigate deprecated Doctrine DBAL connection options
- Task #105297Deprecate `tableoptions` and `collate` connection configuration