From ea871ea032c78f58fa43bd672b96c5a66339fcf3 Mon Sep 17 00:00:00 2001 From: Raphael Bicker Date: Thu, 24 Mar 2016 17:53:55 +0100 Subject: [PATCH] Fix Cannot execute queries while other unbuffered queries are active fixes #11264 Signed-off-by: Eric Lippmann --- library/Icinga/Data/Db/DbConnection.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Data/Db/DbConnection.php b/library/Icinga/Data/Db/DbConnection.php index f643d4849..e9d3bd5f0 100644 --- a/library/Icinga/Data/Db/DbConnection.php +++ b/library/Icinga/Data/Db/DbConnection.php @@ -152,11 +152,12 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp */ $driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET SESSION SQL_MODE=\'STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,' - . 'NO_AUTO_CREATE_USER,ANSI_QUOTES,PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION\';'; + . 'NO_AUTO_CREATE_USER,ANSI_QUOTES,PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION\''; if (array_key_exists('charset', $adapterParamaters) && $adapterParamaters['charset']) { - $driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .= 'SET NAMES ' . $adapterParamaters['charset']. ';'; + $driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .= ', NAMES ' . $adapterParamaters['charset']; unset($adapterParamaters['charset']); } + $driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .=';'; $adapterParamaters['port'] = $this->config->get('port', 3306); break;