diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-02 12:47:16 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-02 12:47:16 +0100 |
commit | c8b3ac4fa57fed397b6d1085f8ff99c25c7a9221 (patch) | |
tree | 32687bedd72fc8ff664aa16b59d714867bba5141 /system/database/drivers/oci8/oci8_driver.php | |
parent | f4ec1f21d5d53ce7c2a1076ca8fd3ab2e6223a6e (diff) | |
parent | 8f22057724dd8fe2b9d41ba98bfc4da282572c5e (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-db-sqlite
Diffstat (limited to 'system/database/drivers/oci8/oci8_driver.php')
-rw-r--r-- | system/database/drivers/oci8/oci8_driver.php | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index d9acaaea6..6da6dc724 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -529,13 +529,11 @@ class CI_DB_oci8_driver extends CI_DB { /** * The error message string * - * @access protected - * @return string + * @return string */ protected function _error_message() { - // If the error was during connection, no conn_id should be passed - $error = is_resource($this->conn_id) ? oci_error($this->conn_id) : oci_error(); + $error = $this->_oci8_error_data(); return $error['message']; } @@ -544,19 +542,43 @@ class CI_DB_oci8_driver extends CI_DB { /** * The error message number * - * @access protected - * @return integer + * @return string */ protected function _error_number() { - // Same as _error_message() - $error = is_resource($this->conn_id) ? oci_error($this->conn_id) : oci_error(); + $error = $this->_oci8_error_data(); return $error['code']; } // -------------------------------------------------------------------- /** + * OCI8-specific method to get errors. + * Used by _error_message() and _error_code(). + * + * @return array + */ + protected function _oci8_error_data() + { + if (is_resource($this->curs_id)) + { + 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 oci_error(); + } + + // -------------------------------------------------------------------- + + /** * Escape the SQL Identifiers * * This function escapes column and table names |