summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-05-13 22:28:11 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-05-13 22:28:11 +0200
commitf38fe09dfecde176dc2803dd6a55177666f7d616 (patch)
treed87a44ada86e8de8e40a1dec1e1c91c92d3bc103 /system/database
parent516841eaaefec8c7093d2cf37fc4b1be127e7580 (diff)
hotfix for a bug in database error display introduced by 1.6.2 fix for bugs #4451, #4299, and #4339
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_driver.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 306f09d7d..a0833d0ce 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -308,18 +308,23 @@ class CI_DB_driver {
if ($this->db_debug)
{
+ // grab the error number and message now, as we might run some
+ // additional queries before displaying the error
+ $error_no = $this->_error_number();
+ $error_msg = $this->_error_message();
+
// We call this function in order to roll-back queries
// if transactions are enabled. If we don't call this here
// the error message will trigger an exit, causing the
// transactions to remain in limbo.
$this->trans_complete();
-
+
// Log and display errors
log_message('error', 'Query error: '.$this->_error_message());
return $this->display_error(
array(
- 'Error Number: '.$this->_error_number(),
- $this->_error_message(),
+ 'Error Number: '.$error_no,
+ $error_msg,
$sql
)
);