diff options
author | Andrey Andreev <narf@devilix.net> | 2015-12-14 15:22:33 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-12-14 15:22:33 +0100 |
commit | bc05b84995d5425d6bdc28c43174e70b720840ce (patch) | |
tree | 24c9170c249a575c66a68252af078287bac5c3a0 /system/database/drivers/pdo/subdrivers/pdo_oci_driver.php | |
parent | 27ba5e6957c9e245478285191b5a88df4bcdc5bb (diff) |
Fix version() for Oracle DB drivers
Diffstat (limited to 'system/database/drivers/pdo/subdrivers/pdo_oci_driver.php')
-rw-r--r-- | system/database/drivers/pdo/subdrivers/pdo_oci_driver.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php b/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php index d17e311f7..4791ab157 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php @@ -130,6 +130,29 @@ class CI_DB_pdo_oci_driver extends CI_DB_pdo_driver { // -------------------------------------------------------------------- /** + * Database version number + * + * @return string + */ + public function version() + { + if (isset($this->data_cache['version'])) + { + return $this->data_cache['version']; + } + + $version_string = parent::version(); + if (preg_match('#Release\s(?<version>\d+(?:\.\d+)+)#', $version_string, $match)) + { + return $this->data_cache['version'] = $match[1]; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** * Show table query * * Generates a platform-specific query string so that the table names can be fetched |