Skip to content

Commit

Permalink
Include set names for MySQL
Browse files Browse the repository at this point in the history
Ensure that MySQL connections are in the desired encoding.

Refs #6332
  • Loading branch information
markstory committed Apr 15, 2015
1 parent 0b2b2aa commit 20bec08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Database/Driver/Mysql.php
Expand Up @@ -62,6 +62,9 @@ public function connect()
if (!empty($config['timezone'])) {
$config['init'][] = sprintf("SET time_zone = '%s'", $config['timezone']);
}
if (!empty($config['encoding'])) {
$config['init'][] = sprintf("SET NAMES %s", $config['encoding']);
}

$config['flags'] += [
PDO::ATTR_PERSISTENT => $config['persistent'],
Expand Down

0 comments on commit 20bec08

Please sign in to comment.