diff options
author | Habeas Codice <habeascodice@federated.social> | 2015-09-07 16:28:42 -0700 |
---|---|---|
committer | Habeas Codice <habeascodice@federated.social> | 2015-09-07 16:28:42 -0700 |
commit | 6711ceb662a997d4f44743266a792ec762790d05 (patch) | |
tree | 77252ea824e7668225c0f4e9817c058e4f9179dc /include | |
parent | dc7677f5fa6fa083a2386b252676b247f4b6fd27 (diff) | |
download | volse-hubzilla-6711ceb662a997d4f44743266a792ec762790d05.tar.gz volse-hubzilla-6711ceb662a997d4f44743266a792ec762790d05.tar.bz2 volse-hubzilla-6711ceb662a997d4f44743266a792ec762790d05.zip |
fix postgres zotfeed
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 10 |
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) ); |