feature #39971 [Cache] Change PDO cache table collate from utf8_bin to utf8mb4_bin (pdragun)

This PR was merged into the 5.3-dev branch.

Discussion
----------

[Cache] Change PDO cache table collate from utf8_bin to utf8mb4_bin

| Q             | A
| ------------- | ---
| Branch?       | 5.x for features
| Bug fix?      | no
| New feature?  | no
| Deprecations? |no
| Tickets       | Fix #39969
| License       | MIT

Change PDO cache table collate from utf8_bin to utf8mb4_bin

Commits
-------

43a9a54aab [Cache] Change PDO cache table collate from utf8_bin to utf8mb4_bin
This commit is contained in:
Fabien Potencier 2021-01-25 22:42:09 +01:00
commit c335e07c92
2 changed files with 2 additions and 2 deletions

View File

@ -138,7 +138,7 @@ class PdoAdapter extends AbstractAdapter implements PruneableInterface
// - trailing space removal // - trailing space removal
// - case-insensitivity // - case-insensitivity
// - language processing like é == e // - language processing like é == e
$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"; $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 utf8mb4_bin, ENGINE = InnoDB";
break; break;
case 'sqlite': case 'sqlite':
$sql = "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER, $this->timeCol INTEGER NOT NULL)"; $sql = "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER, $this->timeCol INTEGER NOT NULL)";

View File

@ -284,7 +284,7 @@ class PdoStore implements PersistingStoreInterface
switch ($driver) { switch ($driver) {
case 'mysql': case 'mysql':
$sql = "CREATE TABLE $this->table ($this->idCol VARCHAR(64) NOT NULL PRIMARY KEY, $this->tokenCol VARCHAR(44) NOT NULL, $this->expirationCol INTEGER UNSIGNED NOT NULL) COLLATE utf8_bin, ENGINE = InnoDB"; $sql = "CREATE TABLE $this->table ($this->idCol VARCHAR(64) NOT NULL PRIMARY KEY, $this->tokenCol VARCHAR(44) NOT NULL, $this->expirationCol INTEGER UNSIGNED NOT NULL) COLLATE utf8mb4_bin, ENGINE = InnoDB";
break; break;
case 'sqlite': case 'sqlite':
$sql = "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->tokenCol TEXT NOT NULL, $this->expirationCol INTEGER)"; $sql = "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->tokenCol TEXT NOT NULL, $this->expirationCol INTEGER)";