summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-09-18 15:32:15 +0200
committerAleksander Machniak <alec@alec.pl>2014-09-18 15:32:15 +0200
commite7af012bc22722dbe63e9e79729f546d4efa934c (patch)
tree7e8cba6139b3755e9af719356cedf2cada0cdb67 /program
parent84515776597960a8f33172ae2a38b418c944fdbb (diff)
Fix binary operator use for Oracle
Diffstat (limited to 'program')
-rw-r--r--program/lib/Roundcube/rcube_imap_cache.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_imap_cache.php b/program/lib/Roundcube/rcube_imap_cache.php
index 519132126..6ba6b8b4c 100644
--- a/program/lib/Roundcube/rcube_imap_cache.php
+++ b/program/lib/Roundcube/rcube_imap_cache.php
@@ -562,6 +562,8 @@ class rcube_imap_cache
}
}
+ $binary_check = $this->db->db_provider == 'oracle' ? "BITAND(`flags`, %d)" : "(`flags` & %d)";
+
$this->db->query(
"UPDATE {$this->messages_table}"
." SET `expires` = ". ($this->ttl ? $this->db->now($this->ttl) : 'NULL')
@@ -570,6 +572,7 @@ class rcube_imap_cache
." AND `mailbox` = ?"
.(!empty($uids) ? " AND `uid` IN (".$this->db->array2list($uids, 'integer').")" : "")
." AND (`flags` & $idx) ".($enabled ? "= 0" : "= $idx"),
+ ." AND " . sprintf($binary_check, $idx) . ($enabled ? " = 0" : " = $idx"),
$this->userid, $mailbox);
}