summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/oci8/oci8_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/oci8/oci8_driver.php')
-rw-r--r--system/database/drivers/oci8/oci8_driver.php49
1 files changed, 14 insertions, 35 deletions
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 6da6dc724..8db6c1286 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -139,14 +139,15 @@ class CI_DB_oci8_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * Version number query string
+ * Database version number
*
- * @access protected
- * @return string
+ * @return string
*/
- protected function _version()
+ public function version()
{
- return oci_server_version($this->conn_id);
+ return isset($this->data_cache['version'])
+ ? $this->data_cache['version']
+ : $this->data_cache['version'] = oci_server_version($this->conn_id);
}
// --------------------------------------------------------------------
@@ -457,8 +458,7 @@ class CI_DB_oci8_driver extends CI_DB {
return 0;
}
- $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE));
-
+ $query = $this->query($this->_count_string.$this->protect_identifiers('numrows').' FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE));
if ($query == FALSE)
{
return 0;
@@ -527,39 +527,18 @@ class CI_DB_oci8_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * The error message string
+ * Error
*
- * @return string
- */
- protected function _error_message()
- {
- $error = $this->_oci8_error_data();
- return $error['message'];
- }
-
- // --------------------------------------------------------------------
-
- /**
- * The error message number
- *
- * @return string
- */
- protected function _error_number()
- {
- $error = $this->_oci8_error_data();
- return $error['code'];
- }
-
- // --------------------------------------------------------------------
-
- /**
- * OCI8-specific method to get errors.
- * Used by _error_message() and _error_code().
+ * Returns an array containing code and message of the last
+ * database error that has occured.
*
* @return array
*/
- protected function _oci8_error_data()
+ public function error()
{
+ /* oci_error() returns an array that already contains the
+ * 'code' and 'message' keys, so we can just return it.
+ */
if (is_resource($this->curs_id))
{
return oci_error($this->curs_id);