aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOPGSQL.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-03-31 16:38:46 +0200
committerGravatar GitHub <noreply@github.com> 2019-03-31 16:38:46 +0200
commitd413f67dd28738f4a6d8cf036e00714737f757b8 (patch)
tree1509f631dc8814bcf85d907a292ddd6437a2efcd /app/Models/EntryDAOPGSQL.php
parent8dcdde6251ae4dfc690b1a014488df125c5e5cdc (diff)
parent2a935516d850d63a215f9650b96ede102311f7ca (diff)
Merge pull request #2298 from FreshRSS/dev1.14.0
FreshRSS 1.14.0
Diffstat (limited to 'app/Models/EntryDAOPGSQL.php')
-rw-r--r--app/Models/EntryDAOPGSQL.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/Models/EntryDAOPGSQL.php b/app/Models/EntryDAOPGSQL.php
index aef258b6f..e571e457f 100644
--- a/app/Models/EntryDAOPGSQL.php
+++ b/app/Models/EntryDAOPGSQL.php
@@ -37,7 +37,9 @@ BEGIN
INSERT INTO `' . $this->prefix . 'entry` (id, guid, title, author, content, link, date, `lastSeen`, hash, is_read, is_favorite, id_feed, tags)
(SELECT rank + row_number() OVER(ORDER BY date) AS id, guid, title, author, content, link, date, `lastSeen`, hash, is_read, is_favorite, id_feed, tags
FROM `' . $this->prefix . 'entrytmp` AS etmp
- WHERE NOT EXISTS (SELECT 1 FROM `' . $this->prefix . 'entry` AS ereal WHERE etmp.id_feed = ereal.id_feed AND etmp.guid = ereal.guid)
+ WHERE NOT EXISTS (
+ SELECT 1 FROM `' . $this->prefix . 'entry` AS ereal
+ WHERE (etmp.id = ereal.id) OR (etmp.id_feed = ereal.id_feed AND etmp.guid = ereal.guid))
ORDER BY date);
DELETE FROM `' . $this->prefix . 'entrytmp` WHERE id <= maxrank;
END $$;';