From: Davide Franco Date: Mon, 18 Jul 2011 07:44:32 +0000 (+0200) Subject: bacula-web: Added PDO connection option for mysql driver X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0448dd6ec41866b9516269829694b4d5500c1345;p=bacula%2Fbacula bacula-web: Added PDO connection option for mysql driver --- diff --git a/gui/bacula-web/includes/db/cdb.class.php b/gui/bacula-web/includes/db/cdb.class.php index f46931c6df..1c7304b4d5 100644 --- a/gui/bacula-web/includes/db/cdb.class.php +++ b/gui/bacula-web/includes/db/cdb.class.php @@ -34,8 +34,7 @@ class CDB $this->options = array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_CASE => PDO::CASE_LOWER, - PDO::ATTR_STATEMENT_CLASS => array('CDBResult', array($this) ), - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true ); + PDO::ATTR_STATEMENT_CLASS => array('CDBResult', array($this) ) ); } public function makeConnection() @@ -53,6 +52,9 @@ class CDB { foreach( $this->options as $option => $value ) $this->connection->setAttribute( $option, $value); + + if( $this->getDriver() == 'mysql' ) + $this->connection->setAttribute( PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true ); } public function getDriver()