]> git.wh0rd.org Git - tt-rss.git/commitdiff
Fix for testing filters getting stuck sometimes.
authorBram Schoenmakers <me@bramschoenmakers.nl>
Thu, 19 Jun 2014 08:29:48 +0000 (10:29 +0200)
committerBram Schoenmakers <me@bramschoenmakers.nl>
Thu, 19 Jun 2014 08:29:48 +0000 (10:29 +0200)
Sometimes when testing a filter the database becomes unresponsive, stuck
in a long query.

Solution: properly join ttrss_entries and ttrss_user_entries instead of
working with their carthesian product.

include/functions2.php

index 5228d875ce91a1dcd373f024999a3693a860cab0..507c5343e46e0c3cca80106160cb000595cc885b 100644 (file)
                                // Try to check if SQL regexp implementation chokes on a valid regexp
 
 
-                               $result = db_query("SELECT true AS true_val FROM ttrss_entries,
-                                       ttrss_user_entries, ttrss_feeds
+                               $result = db_query("SELECT true AS true_val
+                                        FROM ttrss_entries
+                                        JOIN ttrss_user_entries ON ttrss_entries.id = ttrss_user_entries.ref_id
+                                        JOIN ttrss_feeds ON ttrss_feeds.id = ttrss_user_entries.feed_id
                                        WHERE $filter_query_part LIMIT 1", false);
 
                                if ($result) {