Skip to content

Commit

Permalink
FIX: Only set MYSQL_ATTR_INIT_COMMAND when using mysql driver (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
kinglozzer committed Jun 7, 2018
1 parent 1658fe7 commit 66f57bd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ORM/Connect/PDOConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ public function connect($parameters, $selectDB = false)
if (!isset($charset)) {
$charset = $connCharset;
}
$options = array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES ' . $charset . ' COLLATE ' . $connCollation
);

$options = [];
if ($parameters['driver'] === 'mysql') {
$options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES ' . $charset . ' COLLATE ' . $connCollation;
}

// Set SSL options if they are defined
if (array_key_exists('ssl_key', $parameters) &&
Expand Down

0 comments on commit 66f57bd

Please sign in to comment.