summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/drivers/oci8/oci8_driver.php20
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 14 insertions, 7 deletions
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 59f0e8456..60fab7578 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/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index eb36b0d1e..7d1d961c0 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -29,6 +29,7 @@ Bug fixes for 3.0.7
- Fixed a bug (#4605) - :doc:`Config Library <libraries/config>` method ``site_url()`` stripped trailing slashes from relative URIs passed to it.
- Fixed a bug (#4613) - :doc:`Email Library <libraries/config>` failed to send multiple emails via SMTP due to "already authenticated" errors when keep-alive is enabled.
- Fixed a bug (#4633) - :doc:`Form Validation Library <libraries/form_validation>` ignored multiple "callback" rules for empty, non-required fields.
+- Fixed a bug (#4637) - :doc:`Database <database/index>` method `error()` returned ``FALSE`` with the 'oci8' driver if there was no error.
Version 3.0.6
=============