Merge pull request #8147 from kinglozzer/mysql-pdo-attr

FIX: Only set MYSQL_ATTR_INIT_COMMAND when using mysql driver (fixes #8103)
This commit is contained in:
Daniel Hensby 2018-06-08 13:06:03 +01:00 committed by GitHub
commit e1450b5e82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,9 +176,11 @@ class PDOConnector extends DBConnector
if (!isset($charset)) { if (!isset($charset)) {
$charset = $connCharset; $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 // Set SSL options if they are defined
if (array_key_exists('ssl_key', $parameters) && if (array_key_exists('ssl_key', $parameters) &&