aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-07 18:13:17 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-07 18:13:17 -0700
commit5751437c93d43c07726cf122c87a39ac522032c6 (patch)
tree5362144a7563c550bfc5146d3b52235049140cf1 /include/items.php
parent9fa0490c4494b4c01f6b2bb84cb0915562127fe4 (diff)
parent6711ceb662a997d4f44743266a792ec762790d05 (diff)
downloadvolse-hubzilla-5751437c93d43c07726cf122c87a39ac522032c6.tar.gz
volse-hubzilla-5751437c93d43c07726cf122c87a39ac522032c6.tar.bz2
volse-hubzilla-5751437c93d43c07726cf122c87a39ac522032c6.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php
index 01b4a3460..981f52d7a 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4588,10 +4588,12 @@ function zot_feed($uid,$observer_hash,$arr) {
$items = array();
- /** @FIXME fix this part for PostgreSQL */
+ /** @FIXME re-unite these SQL statements. There is no need for them to be separate. The mySQL is convoluted with misuse of group by. As it stands, there is a slight difference where the postgres version doesn't remove the duplicate parents up to 100. In practice this doesn't matter. It could be made to match behavior by adding "distinct on (parent) " to the front of the selection list, at a not-worth-it performance penalty (page temp results to disk). duplicates are still ignored in the in() clause, you just get less than 100 parents if there are many children. */
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
- return array();
+ $groupby = '';
+ } else {
+ $groupby = 'GROUP BY parent';
}
if(is_sys_channel($uid)) {
@@ -4599,7 +4601,7 @@ function zot_feed($uid,$observer_hash,$arr) {
WHERE uid != %d
AND item_private = 0 AND item_restrict = 0 AND uid in (" . stream_perms_api_uids(PERMS_PUBLIC,10,1) . ")
AND (item_flags & %d) > 0
- $sql_extra GROUP BY parent ORDER BY created ASC $limit",
+ $sql_extra $groupby ORDER BY created ASC $limit",
intval($uid),
intval(ITEM_WALL)
);
@@ -4608,7 +4610,7 @@ function zot_feed($uid,$observer_hash,$arr) {
$r = q("SELECT parent, created, postopts from item
WHERE uid = %d AND item_restrict = 0
AND (item_flags & %d) > 0
- $sql_extra GROUP BY parent ORDER BY created ASC $limit",
+ $sql_extra $groupby ORDER BY created ASC $limit",
intval($uid),
intval(ITEM_WALL)
);