From 5dcdbc30649d8f8320953f3eb728a3eb5a7f7765 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Mon, 13 Feb 2012 21:15:56 +0700 Subject: Semicolon automatically added if not exists after hostname, if only database was not empty --- system/database/drivers/pdo/pdo_driver.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 2138ed665..5991586c7 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -118,6 +118,13 @@ class CI_DB_pdo_driver extends CI_DB { // We need to get the prefix (pdodriver used by PDO). $this->dsn = $this->hostname; $this->pdodriver = current(explode(':', $this->hostname)); + + // End dsn with a semicolon for extra backward compability + // if database property was not empty. + if ( ! empty($this->database)) + { + $this->dsn .= rtrim($this->dsn, ';').';'; + } } else { @@ -175,8 +182,6 @@ class CI_DB_pdo_driver extends CI_DB { // Add charset to the DSN, if needed if ( ! empty($this->char_set) && in_array($this->pdodriver, array('4D', 'mysql', 'sybase', 'mssql', 'dblib', 'oci'))) { - // End dsn with a semicolon for extra backward compability - $this->dsn .= rtrim($this->dsn, ';').';'; $this->dsn .= 'charset='.$this->char_set.';'; } } -- cgit v1.2.3-24-g4f1b