From 66f57bd4dac0bd4c8106f8071ddc45103c2643f2 Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Thu, 7 Jun 2018 10:24:27 +0100 Subject: [PATCH] FIX: Only set MYSQL_ATTR_INIT_COMMAND when using mysql driver (fixes #8103) --- src/ORM/Connect/PDOConnector.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ORM/Connect/PDOConnector.php b/src/ORM/Connect/PDOConnector.php index ca4cf309f..f3fbae164 100644 --- a/src/ORM/Connect/PDOConnector.php +++ b/src/ORM/Connect/PDOConnector.php @@ -176,9 +176,11 @@ class PDOConnector extends DBConnector 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) &&