summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/oci8
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/oci8')
-rw-r--r--system/database/drivers/oci8/oci8_driver.php20
-rw-r--r--system/database/drivers/oci8/oci8_forge.php1
2 files changed, 13 insertions, 8 deletions
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 59f0e8456..df7e0848a 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -559,23 +559,29 @@ class CI_DB_oci8_driver extends CI_DB {
*/
public function error()
{
- /* oci_error() returns an array that already contains the
- * 'code' and 'message' keys, so we can just return it.
- */
+ // oci_error() returns an array that already contains
+ // 'code' and 'message' keys, but it can return false
+ // if there was no error ....
if (is_resource($this->curs_id))
{
- return oci_error($this->curs_id);
+ $error = oci_error($this->curs_id);
}
elseif (is_resource($this->stmt_id))
{
- return oci_error($this->stmt_id);
+ $error = oci_error($this->stmt_id);
}
elseif (is_resource($this->conn_id))
{
- return oci_error($this->conn_id);
+ $error = oci_error($this->conn_id);
+ }
+ else
+ {
+ $error = oci_error();
}
- return oci_error();
+ return is_array($error)
+ ? $error
+ : array('code' => '', 'message' => '');
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php
index 989c7a8b7..23e025757 100644
--- a/system/database/drivers/oci8/oci8_forge.php
+++ b/system/database/drivers/oci8/oci8_forge.php
@@ -182,5 +182,4 @@ class CI_DB_oci8_forge extends CI_DB_forge {
default: return;
}
}
-
}