summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-04-30 11:49:35 +0200
committerAleksander Machniak <alec@alec.pl>2013-04-30 11:49:35 +0200
commit8defd73ee0f86f5fe83c4ae5a4d568d140599736 (patch)
tree8eb0573864baf86a2c0b23f1d94dfce3a9a9191a
parent259d37be3e992e06a899b82a0d60bef2148f82b4 (diff)
Inlcude SQL query in the log on SQL error (#1489064)
-rw-r--r--CHANGELOG1
-rw-r--r--program/lib/Roundcube/rcube_db.php11
2 files changed, 7 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5ac7e5955..898c34f24 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Inlcude SQL query in the log on SQL error (#1489064)
- Fix handling untagged responses in IMAP FETCH - "could not load message" error (#1489074)
- Fix very small window size in Chrome (#1488931)
- Fix list page reset when viewing a message in Larry skin (#1489076)
diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php
index d86e3dd98..c96bccc90 100644
--- a/program/lib/Roundcube/rcube_db.php
+++ b/program/lib/Roundcube/rcube_db.php
@@ -405,21 +405,22 @@ class rcube_db
$this->db_error_msg = null;
// send query
- $query = $this->dbh->query($query);
+ $result = $this->dbh->query($query);
- if ($query === false) {
+ if ($result === false) {
$error = $this->dbh->errorInfo();
$this->db_error = true;
$this->db_error_msg = sprintf('[%s] %s', $error[1], $error[2]);
rcube::raise_error(array('code' => 500, 'type' => 'db',
'line' => __LINE__, 'file' => __FILE__,
- 'message' => $this->db_error_msg), true, false);
+ 'message' => $this->db_error_msg . " (SQL Query: $query)"
+ ), true, false);
}
- $this->last_result = $query;
+ $this->last_result = $result;
- return $query;
+ return $result;
}
/**