diff options
author | Andrew Dolgov <[email protected]> | 2020-12-03 14:42:01 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-12-03 14:42:01 +0300 |
commit | e9673eb13d0cd549868db5b77adf81eb03aa5b8a (patch) | |
tree | f6c1c38fdad38bcaf387beda090703157c2cdd51 /classes | |
parent | 81c52b4b1e73bcc44cbe93fa926036277a961208 (diff) |
experimental: add optional _HEADLINES_QUERY_NO_DISTINCT to disable DISTINCT keyword in queryFeedHeadlines query
Diffstat (limited to 'classes')
-rwxr-xr-x | classes/feeds.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index c1b7e8022..93dc2d2d8 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -1412,8 +1412,11 @@ class Feeds extends Handler_Protected { $pdo = Db::pdo(); + // experimental: define _HEADLINES_QUERY_NO_DISTINCT to disable DISTINCT keyword on headline queries + $HEADLINES_QUERY_DISTINCT = defined('_HEADLINES_QUERY_NO_DISTINCT') ? "" : "DISTINCT"; + // WARNING: due to highly dynamic nature of this query its going to quote parameters - // right before adding them to SQL part + // right before adding them to SQL part $feed = $params["feed"]; $limit = isset($params["limit"]) ? $params["limit"] : 30; @@ -1729,7 +1732,7 @@ class Feeds extends Handler_Protected { if (!$search && !$skip_first_id_check) { // if previous topmost article id changed that means our current pagination is no longer valid - $query = "SELECT DISTINCT + $query = "SELECT $HEADLINES_QUERY_DISTINCT ttrss_feeds.title, date_entered, $yyiw_qpart, @@ -1769,7 +1772,7 @@ class Feeds extends Handler_Protected { } } - $query = "SELECT DISTINCT + $query = "SELECT $HEADLINES_QUERY_DISTINCT date_entered, $yyiw_qpart, guid, @@ -1810,7 +1813,7 @@ class Feeds extends Handler_Protected { } else { // browsing by tag - $query = "SELECT DISTINCT + $query = "SELECT $HEADLINES_QUERY_DISTINCT date_entered, guid, note, |