summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-08-19 22:24:16 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-08-19 22:24:16 -0400
commit3db8c525328e1595bd66b8f86057415855e4d6ef (patch)
treeec6144281c7cc5fa3eb6c4eec13ef9519bf86e08 /lib
parent32bd7c839c8538b9f892c11893c140bb70677636 (diff)
fixes issue with bitfield on postgresql
Diffstat (limited to 'lib')
-rw-r--r--lib/itemmapper.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/itemmapper.php b/lib/itemmapper.php
index 4a8b569e1..70b616985 100644
--- a/lib/itemmapper.php
+++ b/lib/itemmapper.php
@@ -73,7 +73,7 @@ class ItemMapper {
public function findAllStatus($feedid, $status){
$stmt = \OCP\DB::prepare('SELECT * FROM ' . self::tableName . '
WHERE feed_id = ?
- AND (status & ?)
+ AND ((status & ?) > 0)
ORDER BY pub_date DESC');
$result = $stmt->execute(array($feedid, $status));
@@ -95,7 +95,7 @@ class ItemMapper {
JOIN '. FeedMapper::tableName .' ON
'. FeedMapper::tableName .'.id = ' . self::tableName . '.feed_id
WHERE '. FeedMapper::tableName .'.user_id = ?
- AND (' . self::tableName . '.status & ?)
+ AND ((' . self::tableName . '.status & ?) > 0)
ORDER BY ' . self::tableName . '.pub_date DESC');
$result = $stmt->execute(array($this->userid, $status));
@@ -111,7 +111,7 @@ class ItemMapper {
public function countAllStatus($feedid, $status){
$stmt = \OCP\DB::prepare('SELECT COUNT(*) as size FROM ' . self::tableName . '
WHERE feed_id = ?
- AND (status & ?)');
+ AND ((status & ?) > 0)');
$result=$stmt->execute(array($feedid, $status))->fetchRow();
return $result['size'];
}
@@ -125,7 +125,7 @@ class ItemMapper {
JOIN '. FeedMapper::tableName .' ON
'. FeedMapper::tableName .'.id = ' . self::tableName . '.feed_id
WHERE '. FeedMapper::tableName .'.user_id = ?
- AND (' . self::tableName . '.status & ?)');
+ AND ((' . self::tableName . '.status & ?) > 0)');
$result = $stmt->execute(array($this->userid, $status))->fetchRow();;
return $result['size'];