]> git.wh0rd.org Git - tt-rss.git/commitdiff
catchup maybe add workaround for mysql 5.7 derived_merge
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 3 Dec 2015 12:33:36 +0000 (15:33 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 3 Dec 2015 12:33:36 +0000 (15:33 +0300)
include/functions.php

index 8d1c2a625299f99df1bdf25701bc500cd38e6d57..fb7b3244cc0d740a2bc33067ea56399fdc3c7405 100755 (executable)
 
                                                db_query("UPDATE ttrss_user_entries
                                                        SET unread = false, last_read = NOW() WHERE ref_id IN
-                                                               (SELECT id FROM
+                                                               (SELECT DISTINCT id FROM
                                                                        (SELECT id FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id
                                                                                AND owner_uid = $owner_uid AND unread = true AND feed_id IN
                                                                                        (SELECT id FROM ttrss_feeds WHERE $cat_qpart) AND $date_qpart) as tmp)");
 
                                        db_query("UPDATE ttrss_user_entries
                                                SET unread = false, last_read = NOW() WHERE ref_id IN
-                                                       (SELECT id FROM
+                                                       (SELECT DISTINCT id FROM
                                                                (SELECT id FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id
                                                                        AND owner_uid = $owner_uid AND unread = true AND feed_id = $feed AND $date_qpart) as tmp)");
 
                                        if ($feed == -1) {
                                                db_query("UPDATE ttrss_user_entries
                                                        SET unread = false, last_read = NOW() WHERE ref_id IN
-                                                               (SELECT id FROM
+                                                               (SELECT DISTINCT id FROM
                                                                        (SELECT id FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id
                                                                                AND owner_uid = $owner_uid AND unread = true AND marked = true AND $date_qpart) as tmp)");
                                        }
                                        if ($feed == -2) {
                                                db_query("UPDATE ttrss_user_entries
                                                        SET unread = false, last_read = NOW() WHERE ref_id IN
-                                                               (SELECT id FROM
+                                                               (SELECT DISTINCT id FROM
                                                                        (SELECT id FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id
                                                                                AND owner_uid = $owner_uid AND unread = true AND published = true AND $date_qpart) as tmp)");
                                        }
 
                                                db_query("UPDATE ttrss_user_entries
                                                        SET unread = false, last_read = NOW() WHERE ref_id IN
-                                                               (SELECT id FROM
+                                                               (SELECT DISTINCT id FROM
                                                                        (SELECT id FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id
                                                                                AND owner_uid = $owner_uid AND score >= 0 AND unread = true AND $date_qpart AND $match_part) as tmp)");
                                        }
                                        if ($feed == -4) {
                                                db_query("UPDATE ttrss_user_entries
                                                        SET unread = false, last_read = NOW() WHERE ref_id IN
-                                                               (SELECT id FROM
+                                                               (SELECT DISTINCT id FROM
                                                                        (SELECT id FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id
                                                                                AND owner_uid = $owner_uid AND unread = true AND $date_qpart) as tmp)");
                                        }
 
                                        db_query("UPDATE ttrss_user_entries
                                                SET unread = false, last_read = NOW() WHERE ref_id IN
-                                                       (SELECT id FROM
+                                                       (SELECT DISTINCT id FROM
                                                                (SELECT ttrss_entries.id FROM ttrss_entries, ttrss_user_entries, ttrss_user_labels2 WHERE ref_id = id
                                                                        AND label_id = '$label_id' AND ref_id = article_id
                                                                        AND owner_uid = $owner_uid AND unread = true AND $date_qpart) as tmp)");
                        } else { // tag
                                db_query("UPDATE ttrss_user_entries
                                        SET unread = false, last_read = NOW() WHERE ref_id IN
-                                               (SELECT id FROM
+                                               (SELECT DISTINCT id FROM
                                                        (SELECT ttrss_entries.id FROM ttrss_entries, ttrss_user_entries, ttrss_tags WHERE ref_id = ttrss_entries.id
                                                                AND post_int_id = int_id AND tag_name = '$feed'
                                                                AND ttrss_user_entries.owner_uid = $owner_uid AND unread = true AND $date_qpart) as tmp)");