summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/postgre
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-05 16:01:11 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-05 16:01:11 +0100
commit2b73037e450859e85fb468ad7499a26882a67292 (patch)
tree8388444fba44c5188c8977949d4a931320cd3e05 /system/database/drivers/postgre
parent522c73623b46afc9082ac7c8af5c34bf1b4f47f4 (diff)
Fix DB drivers version() implementations that don't execute a query
Fails if called prior to the DB connection initialization.
Diffstat (limited to 'system/database/drivers/postgre')
-rw-r--r--system/database/drivers/postgre/postgre_driver.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 028dc1996..40f21b1e8 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -204,8 +204,12 @@ class CI_DB_postgre_driver extends CI_DB {
{
return $this->data_cache['version'];
}
+ elseif ( ! $this->conn_id)
+ {
+ $this->initialize();
+ }
- if (($pg_version = pg_version($this->conn_id)) === FALSE)
+ if ( ! $this->conn_id OR ($pg_version = pg_version($this->conn_id)) === FALSE)
{
return FALSE;
}