diff options
-rw-r--r-- | system/database/drivers/oci8/oci8_driver.php | 32 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 2 |
2 files changed, 19 insertions, 15 deletions
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 9047c2185..a8b410947 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -586,7 +586,7 @@ class CI_DB_oci8_driver extends CI_DB { */ protected function _error_message() { - $error = self::_get_error_data(); + $error = $this->_oci8_error_data(); return $error['message']; } @@ -595,35 +595,39 @@ class CI_DB_oci8_driver extends CI_DB { /** * The error message number * - * @return int + * @return string */ protected function _error_number() { - $error = self::_get_error_data(); + $error = $this->_oci8_error_data(); return $error['code']; } // -------------------------------------------------------------------- - /* Get error data + /** + * OCI8-specific method to get errors. * - * Used by _error_message() and _error_number() + * Used by _error_message() and _error_code(). * * @return array */ - private function _get_error_data() + protected function _oci8_error_data() { - $res = NULL; - foreach (array('curs_id', 'stmt_id', 'conn_id') as $key) + if (is_resource($this->curs_id)) { - if (is_resource($this->$key)) - { - $res = $this->$key; - break; - } + return oci_error($this->curs_id); + } + elseif (is_resource($this->stmt_id)) + { + return oci_error($this->stmt_id); + } + elseif (is_resource($this->conn_id)) + { + return oci_error($this->conn_id); } - return ( ! is_null($res)) ? oci_error($res) : oci_error(); + return oci_error(); } // -------------------------------------------------------------------- diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 1260c26e5..c7d377b16 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -128,8 +128,8 @@ Bug fixes for 3.0 - Fixed a bug in PDO's insert_id() method where it could've failed if it's used with Postgre versions prior to 8.1. - Fixed a bug in CUBRID's affected_rows() method where a connection resource was passed to cubrid_affected_rows() instead of a result. - Fixed a bug (#638) - db_set_charset() ignored its arguments and always used the configured charset and collation instead. +- Fixed a bug (#413) - Oracle's _error_message() and _error_number() methods used to only return connection-related errors. - Fixed a bug in the Oracle (oci8) instance of :doc:`Database Forge Class <database/forge>` where create_table() would fail if used with AUTO_INCREMENT as it's not supported by Oracle. -- Fixed a bug (#413) - The Oracle (oci8) database driver only used to return connection-related errors in _error_message() and _error_number(). Version 2.1.1 ============= |