diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-03-23 14:24:06 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-03-23 14:24:06 +0100 |
commit | d0f6e6ab2e1dbb968a0ef0021f0b9cd64313863b (patch) | |
tree | a8cd95ddf85c9a852f522eae14dda0de4151d38b /system/database/drivers/postgre | |
parent | 006cf0764295d37daa597f4ea9cf31abb75d1b68 (diff) | |
parent | 71e647782764184e3aab4faffe6d99176758979f (diff) |
Merge tag 'ci-upstream/3.1.8' into dev
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'system/database/drivers/postgre')
-rw-r--r-- | system/database/drivers/postgre/postgre_driver.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 7fb258abb..5779c8783 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -224,8 +224,8 @@ class CI_DB_postgre_driver extends CI_DB { * and so we'll have to fall back to running a query in * order to get it. */ - return isset($pg_version['server']) - ? $this->data_cache['version'] = $pg_version['server'] + return (isset($pg_version['server']) && preg_match('#^(\d+\.\d+)#', $pg_version['server'], $match)) + ? $this->data_cache['version'] = $match[1] : parent::version(); } @@ -354,8 +354,7 @@ class CI_DB_postgre_driver extends CI_DB { */ public function insert_id() { - $v = pg_version($this->conn_id); - $v = isset($v['server']) ? $v['server'] : 0; // 'server' key is only available since PosgreSQL 7.4 + $v = $this->version(); $table = (func_num_args() > 0) ? func_get_arg(0) : NULL; $column = (func_num_args() > 1) ? func_get_arg(1) : NULL; |