summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2009-12-16 18:32:33 +0100
committerDerek Allard <derek.allard@ellislab.com>2009-12-16 18:32:33 +0100
commit3683f775bec4993b3777b012a087e82d6bff8d3f (patch)
tree054733cf7ddba15b5d804a6286a44fbb1bee9edf
parent25f3ce3b697fe77d0a8930be154321f88e7df7f3 (diff)
Change to CI's db->version() function to allow a list of exceptions for dbs with functions to return version string, vs SQL queries to return version strings. Currently this list only includes Oracle and SQLite.
-rw-r--r--system/database/DB_driver.php16
-rw-r--r--user_guide/changelog.html5
2 files changed, 16 insertions, 5 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 014dfd44e..aee06205b 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -215,14 +215,20 @@ class CI_DB_driver {
}
return FALSE;
}
-
- if ($this->dbdriver == 'oci8')
+
+ // Some DBs have functions that return the version, and don't run special
+ // SQL queries per se. In these instances, just return the result.
+ $driver_version_exceptions = array('oci8', 'sqlite');
+
+ if (in_array($this->dbdriver, $driver_version_exceptions))
{
return $sql;
}
-
- $query = $this->query($sql);
- return $query->row('ver');
+ else
+ {
+ $query = $this->query($sql);
+ return $query->row('ver');
+ }
}
// --------------------------------------------------------------------
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 27dff1552..ed987ff3d 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -69,6 +69,11 @@ SVN Revision: </p>
<li>Fixed a language key in the profiler: "profiler_no_memory_usage" to "profiler_no_memory".</li>
</ul>
</li>
+ <li>Database
+ <ul>
+ <li>Semantic change to db->version() function to allow a list of exceptions for databases with functions to return version string instead of specially formed SQL queries. Currently this list only includes Oracle and SQLite.</li>
+ </ul>
+ </li>
<li>Helpers
<ul>
<li>Added accept-charset to the list of inserted attributes of <kbd>form_open()</kbd> in the <a href="helpers/form_helper.html">Form Helper</a>.</li>