diff options
author | Andrey Andreev <narf@devilix.net> | 2020-03-30 10:37:58 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2020-03-30 10:37:58 +0200 |
commit | e76cd850177fefae34c570e5b49c0ba18955c3b5 (patch) | |
tree | 66aa6536a2c69350dcd7dec9a092e24172ece5a1 | |
parent | ac2e0d0c7c1859a2d96ec01c48abd917a36f8f27 (diff) |
[ci skip] Fix #5906
-rw-r--r-- | system/database/drivers/postgre/postgre_driver.php | 15 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
2 files changed, 4 insertions, 12 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 19bd775d0..cfd793339 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -78,22 +78,12 @@ class CI_DB_postgre_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Class constructor + * Build DSN * - * Creates a DSN string to be used for db_connect() and db_pconnect() - * - * @param array $params * @return void */ - public function __construct($params) + protected function _build_dsn() { - parent::__construct($params); - - if ( ! empty($this->dsn)) - { - return; - } - $this->dsn === '' OR $this->dsn = ''; if (strpos($this->hostname, '/') !== FALSE) @@ -149,6 +139,7 @@ class CI_DB_postgre_driver extends CI_DB { */ public function db_connect($persistent = FALSE) { + empty($this->dsn) OR $this->_build_dsn(); $this->conn_id = ($persistent === TRUE) ? pg_pconnect($this->dsn) : pg_connect($this->dsn); diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 2a4a5bd56..a28e5914f 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -24,6 +24,7 @@ Bug fixes for 3.1.12 - Fixed a bug (#5861) - :doc:`Cache Library <libraries/caching>` 'redis' driver would always use phpRedis 5 ``del()`` due to an incorrect version check. - Fixed a bug (#5879) - :doc:`Profiler Library <general/profiling>` triggered an ``E_DEPRECATED`` warning on PHP 7.4+. - Fixed a bug (#5901) - :doc:`Database Library <database/index>` methods ``list_fields()`` and ``field_data()`` ignored the configured table schema on PostgreSQL. +- Fixed a bug (#5906) - :doc:`Database Library <database/index>` 'postgre' driver couldn't use the failover feature without a ``$config['dsn']``. Version 3.1.11 ============== |