summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-08-31 15:03:30 +0200
committerGitHub <noreply@github.com>2017-08-31 15:03:30 +0200
commitced57832bfff0ed9974409ea9c221425f02cfcbf (patch)
tree9ce828b11731a412a2ec88c9eda0f12125b55b70 /system
parent6ffc8f63c8a9a76c5323a4013382a61eb4d7031a (diff)
parentec948d3665d50a5d4786fac4d806941d3e989f7e (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')
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php16
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 08243232e..fbd279681 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);
+ }
}