diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-01 19:14:47 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-01 19:14:47 +0100 |
commit | c667a7e1555bfc6916f01c2a625814ae362a1728 (patch) | |
tree | 7fe61b0e19e281ee146190646f84171aa642e2a0 /system/database/drivers/oci8 | |
parent | 0693447538a7756363f31706b54d0b7503c4952f (diff) | |
parent | 601f8b209d93fe70786776d9170eed5e23201e58 (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/oci8')
-rw-r--r-- | system/database/drivers/oci8/oci8_driver.php | 32 |
1 files changed, 18 insertions, 14 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(); } // -------------------------------------------------------------------- |