diff options
author | Andrey Andreev <narf@devilix.net> | 2017-08-31 15:03:30 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2017-08-31 15:04:28 +0200 |
commit | ce50148cbd3edb6c379b6431a5a55ae2107f9c48 (patch) | |
tree | b34ec89883dd98b3bca1d7b18997ae0c30672426 /system/database | |
parent | 613b898234debcaea5ec9160e5249358ac7e3dfc (diff) |
Merge pull request #5243 from rosseti/fix/pdo-dblib-sqlserver-version
Fix for DBLIB subdriver to get the right version number of SQL Server.
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php index e9226c350..b9b86f784 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php @@ -334,4 +334,20 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver { return ($this->db_debug) ? $this->display_error('db_unsupported_feature') : FALSE; } + // -------------------------------------------------------------------- + + /** + * Database version number + * + * @return string + */ + public function version() + { + if (isset($this->data_cache['version'])) + { + return $this->data_cache['version']; + } + + return $this->data_cache['version'] = $this->conn_id->query("SELECT SERVERPROPERTY('ProductVersion') AS ver")->fetchColumn(0); + } } |