diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-27 15:49:50 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-27 15:49:50 +0100 |
commit | 5b8fff99a50c42194df445d82c665f0123caf10e (patch) | |
tree | 107f052164c758afe9fd397e6d176398be62ded1 | |
parent | f11e4cff46ad6b41f53c2354ca189186b1dd421e (diff) |
make cleanup faster
-rw-r--r-- | db/itemmapper.php | 2 | ||||
-rw-r--r-- | db/postgres/itemmapper.php | 2 | ||||
-rw-r--r-- | tests/unit/db/ItemMapperTest.php | 4 | ||||
-rw-r--r-- | tests/unit/db/postgres/ItemMapperTest.php | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/db/itemmapper.php b/db/itemmapper.php index b1763ed6a..41c2a6975 100644 --- a/db/itemmapper.php +++ b/db/itemmapper.php @@ -242,7 +242,7 @@ class ItemMapper extends NewsMapper { 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . - 'WHERE NOT ((`items`.`status` & ?) > 0) ' . + 'AND NOT ((`items`.`status` & ?) > 0) ' . 'GROUP BY `items`.`feed_id`, `feeds`.`articles_per_update` ' . 'HAVING COUNT(*) > ?'; $params = [$status, $threshold]; diff --git a/db/postgres/itemmapper.php b/db/postgres/itemmapper.php index 643055f1a..f736fe54c 100644 --- a/db/postgres/itemmapper.php +++ b/db/postgres/itemmapper.php @@ -36,7 +36,7 @@ class ItemMapper extends \OCA\News\Db\ItemMapper { 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . - 'WHERE NOT ((`items`.`status` & ?) > 0) ' . + 'AND NOT ((`items`.`status` & ?) > 0) ' . 'GROUP BY `items`.`feed_id`, `feeds`.`articles_per_update` ' . 'HAVING COUNT(*) > ?'; $params = [$status, $threshold]; diff --git a/tests/unit/db/ItemMapperTest.php b/tests/unit/db/ItemMapperTest.php index 2f6b68c1c..46a129ecf 100644 --- a/tests/unit/db/ItemMapperTest.php +++ b/tests/unit/db/ItemMapperTest.php @@ -366,7 +366,7 @@ class ItemMapperTest extends \Test\AppFramework\Db\MapperTestUtility { 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . - 'WHERE NOT ((`items`.`status` & ?) > 0) ' . + 'AND NOT ((`items`.`status` & ?) > 0) ' . 'GROUP BY `items`.`feed_id`, `feeds`.`articles_per_update` ' . 'HAVING COUNT(*) > ?'; @@ -390,7 +390,7 @@ class ItemMapperTest extends \Test\AppFramework\Db\MapperTestUtility { 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . - 'WHERE NOT ((`items`.`status` & ?) > 0) ' . + 'AND NOT ((`items`.`status` & ?) > 0) ' . 'GROUP BY `items`.`feed_id`, `feeds`.`articles_per_update` ' . 'HAVING COUNT(*) > ?'; $params1 = [$status, $threshold]; diff --git a/tests/unit/db/postgres/ItemMapperTest.php b/tests/unit/db/postgres/ItemMapperTest.php index 473641522..22c6bb78c 100644 --- a/tests/unit/db/postgres/ItemMapperTest.php +++ b/tests/unit/db/postgres/ItemMapperTest.php @@ -69,7 +69,7 @@ class ItemMapperTest extends \Test\AppFramework\Db\MapperTestUtility { 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . - 'WHERE NOT ((`items`.`status` & ?) > 0) ' . + 'AND NOT ((`items`.`status` & ?) > 0) ' . 'GROUP BY `items`.`feed_id`, `feeds`.`articles_per_update` ' . 'HAVING COUNT(*) > ?'; @@ -93,7 +93,7 @@ class ItemMapperTest extends \Test\AppFramework\Db\MapperTestUtility { 'FROM `*PREFIX*news_items` `items` ' . 'JOIN `*PREFIX*news_feeds` `feeds` ' . 'ON `feeds`.`id` = `items`.`feed_id` ' . - 'WHERE NOT ((`items`.`status` & ?) > 0) ' . + 'AND NOT ((`items`.`status` & ?) > 0) ' . 'GROUP BY `items`.`feed_id`, `feeds`.`articles_per_update` ' . 'HAVING COUNT(*) > ?'; $params1 = [$status, $threshold]; |