aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2015-09-08 08:39:37 +0200
committerzottel <github@zottel.net>2015-09-08 08:39:37 +0200
commit52cd8652bb4b2454bc2bd49d8ec39a5549c4ab68 (patch)
tree8e25e4395d8ef7f0dbbe0f12450ad4b9d7cb20c0 /include/items.php
parentc5981cbc9afb88015fb59b4743484bb78a87188d (diff)
parentc6bdf7e891f3c0b49a1e9c40622e05aef590e2b6 (diff)
downloadvolse-hubzilla-52cd8652bb4b2454bc2bd49d8ec39a5549c4ab68.tar.gz
volse-hubzilla-52cd8652bb4b2454bc2bd49d8ec39a5549c4ab68.tar.bz2
volse-hubzilla-52cd8652bb4b2454bc2bd49d8ec39a5549c4ab68.zip
Merge remote-tracking branch 'upstream/master'
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 91afad0e6..5d38b0982 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4632,10 +4632,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';
}
$item_normal = item_normal();
@@ -4645,7 +4647,7 @@ function zot_feed($uid,$observer_hash,$arr) {
WHERE uid != %d
$item_normal
AND item_wall = 1
- and item_private = 0 $sql_extra GROUP BY parent ORDER BY created ASC $limit",
+ and item_private = 0 $sql_extra $groupby ORDER BY created ASC $limit",
intval($uid)
);
}
@@ -4653,7 +4655,7 @@ function zot_feed($uid,$observer_hash,$arr) {
$r = q("SELECT parent, created, postopts from item
WHERE uid = %d $item_normal
AND item_wall = 1
- $sql_extra GROUP BY parent ORDER BY created ASC $limit",
+ $sql_extra $groupby ORDER BY created ASC $limit",
intval($uid)
);
}