From 279256fabd55b3fac705be8097ee22d54ceaab50 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 30 Jan 2014 13:50:00 +0200 Subject: Some fail-safe pdo_pgsql adjustments --- system/database/drivers/pdo/pdo_driver.php | 3 +-- system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 184a8df33..3f4275f64 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -92,7 +92,7 @@ class CI_DB_pdo_driver extends CI_DB { { $this->subdriver = '4d'; } - elseif ( ! in_array($this->subdriver, array('4d', 'cubrid', 'dblib', 'firebird', 'ibm', 'informix', 'mysql', 'oci', 'odbc', 'sqlite', 'sqlsrv'), TRUE)) + elseif ( ! in_array($this->subdriver, array('4d', 'cubrid', 'dblib', 'firebird', 'ibm', 'informix', 'mysql', 'oci', 'odbc', 'pgsql', 'sqlite', 'sqlsrv'), TRUE)) { log_message('error', 'PDO: Invalid or non-existent subdriver'); @@ -117,7 +117,6 @@ class CI_DB_pdo_driver extends CI_DB { { $this->options[PDO::ATTR_PERSISTENT] = $persistent; - // Connecting... try { return @new PDO($this->dsn, $this->username, $this->password, $this->options); diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php index 6ee327bd5..24f64cff5 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php @@ -84,6 +84,12 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver { empty($this->port) OR $this->dsn .= ';port='.$this->port; empty($this->database) OR $this->dsn .= ';dbname='.$this->database; + + if ( ! empty($this->username)) + { + $this->dsn .= ';username=$this->username; + empty($this->password) OR $this->dsn .= ';password='.$this->password; + } } } -- cgit v1.2.3-24-g4f1b From 84c090162f277ccd47a78886a1c9295add96e752 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 30 Jan 2014 14:33:59 +0200 Subject: Fix a syntax error from last commit --- system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php index 24f64cff5..8abe66e53 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php @@ -87,7 +87,7 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver { if ( ! empty($this->username)) { - $this->dsn .= ';username=$this->username; + $this->dsn .= ';username=$this->username'; empty($this->password) OR $this->dsn .= ';password='.$this->password; } } -- cgit v1.2.3-24-g4f1b From 76160bc9ea5f0f4c653300231e34faa445342d83 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 30 Jan 2014 22:26:14 +0200 Subject: Previous 2 commits were just dumb --- system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php index 8abe66e53..507abda51 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php @@ -87,7 +87,7 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver { if ( ! empty($this->username)) { - $this->dsn .= ';username=$this->username'; + $this->dsn .= ';username='.$this->username; empty($this->password) OR $this->dsn .= ';password='.$this->password; } } -- cgit v1.2.3-24-g4f1b From f6779f5e2510811a1d4fe39864923226a475f298 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 5 Feb 2014 23:15:26 +0200 Subject: Fix #2856 --- system/database/drivers/odbc/odbc_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 45e91cbc5..6f635bdfb 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -222,7 +222,7 @@ class CI_DB_odbc_driver extends CI_DB { */ public function affected_rows() { - return @odbc_num_rows($this->conn_id); + return @odbc_num_rows($this->result_id); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 33578d209c8cc8a8bce5ccc6f289b6ada9d03adb Mon Sep 17 00:00:00 2001 From: Vivek Dinesh Date: Thu, 6 Feb 2014 09:46:07 +0530 Subject: Typo Fix Signed-off-by: Vivek Dinesh --- system/database/DB_query_builder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 8223baac1..ef690090f 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -263,7 +263,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { $select = explode(',', $select); } - // If the escape value was not set will will base it on the global setting + // If the escape value was not set, we will base it on the global setting is_bool($escape) OR $escape = $this->_protect_identifiers; foreach ($select as $val) -- cgit v1.2.3-24-g4f1b