summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-08-31 15:03:30 +0200
committerAndrey Andreev <narf@devilix.net>2017-08-31 15:04:28 +0200
commitce50148cbd3edb6c379b6431a5a55ae2107f9c48 (patch)
treeb34ec89883dd98b3bca1d7b18997ae0c30672426 /system
parent613b898234debcaea5ec9160e5249358ac7e3dfc (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 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);
+ }
}