Aleksander Machniak
2014-09-18 e7af012bc22722dbe63e9e79729f546d4efa934c
Fix binary operator use for Oracle
1 files modified
3 ■■■■■ changed files
program/lib/Roundcube/rcube_imap_cache.php 3 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_imap_cache.php
@@ -562,6 +562,8 @@
            }
        }
        $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 @@
                ." 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);
    }