Fix for testing filters getting stuck sometimes.

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.
This commit is contained in:
Bram Schoenmakers 2014-06-19 10:29:48 +02:00
parent 32ae0fc2a2
commit 7b3110c9c9
1 changed files with 4 additions and 2 deletions

View File

@ -426,8 +426,10 @@
// Try to check if SQL regexp implementation chokes on a valid regexp // Try to check if SQL regexp implementation chokes on a valid regexp
$result = db_query("SELECT true AS true_val FROM ttrss_entries, $result = db_query("SELECT true AS true_val
ttrss_user_entries, ttrss_feeds 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); WHERE $filter_query_part LIMIT 1", false);
if ($result) { if ($result) {