From ac718628e8b486f8016ac775829a32cfbc9fa3da Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 22 Jun 2016 13:01:51 +0300 Subject: Fix #4674 --- system/database/drivers/pdo/pdo_driver.php | 5 ++++- system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php | 7 ++++++- user_guide_src/source/changelog.rst | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index c6f84e0f9..c27607e55 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -126,7 +126,10 @@ class CI_DB_pdo_driver extends CI_DB { */ public function db_connect($persistent = FALSE) { - $this->options[PDO::ATTR_PERSISTENT] = $persistent; + if ($persistent === TRUE) + { + $this->options[PDO::ATTR_PERSISTENT] = TRUE; + } try { diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php index 84695ee9b..9a1cbcaf4 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php @@ -126,7 +126,12 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver { */ public function db_connect($persistent = FALSE) { - $this->conn_id = parent::db_connect($persistent); + if ($persistent === TRUE) + { + log_message('debug', "dblib driver doesn't support persistent connections"); + } + + $this->conn_id = parent::db_connect(FALSE); if ( ! is_object($this->conn_id)) { diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index da96b009e..ec7239649 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -36,6 +36,7 @@ Bug fixes for 3.0.7 - Fixed a bug (#4583) - :doc:`Email Library ` didn't properly handle inline attachments in HTML emails. - Fixed a bug where :doc:`Database ` method `db_select()` didn't clear metadata cached for the previously used database. - Fixed a bug (#4675) - :doc:`File Helper ` function :php:func:`delete_files()` treated symbolic links as regular directories. +- Fixed a bug (#4674) - :doc:`Database ` driver 'dblib' triggered E_WARNING messages while connecting. Version 3.0.6 ============= -- cgit v1.2.3-24-g4f1b