Skip to content

Cache PdoAdapter has hard coded charset for creating cache table (mysql) #39969

@pdragun

Description

@pdragun

Symfony version(s) affected: 5.2.0

Description
Class PDOAdapter has hard coded charset for creating cache table (only for mysql). Standard charset is now utf8mb4, but cache table is still utf8.

How to reproduce
Line 141
$sql = "CREATE TABLE $this->table ($this->idCol VARBINARY(255) NOT NULL PRIMARY KEY, $this->dataCol MEDIUMBLOB NOT NULL, $this->lifetimeCol INTEGER UNSIGNED, $this->timeCol INTEGER UNSIGNED NOT NULL) COLLATE utf8_bin, ENGINE = InnoDB";

Possible Solution
Remove 'COLLATE utf8_bin' from code above and let user to set COLLATE during creating PDO connection (via dsn, or $options['db_connection_options'] in constructor of PDOAdapter class? Or change utf8 to utf8mb4?

It is in the code from first commit until now.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions