From: Michael <heluecht@pirati.ca>
Date: Sun, 7 Mar 2021 07:54:02 +0000 (+0000)
Subject: Issue 9925: Make query compatibly to MySQL 8
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=98ffcdd08576d298170d1e27e4d3e4b45dccbff2;p=friendica.git

Issue 9925: Make query compatibly to MySQL 8
---

diff --git a/src/Module/Update/Profile.php b/src/Module/Update/Profile.php
index 8c20f400f4..3a4fd85094 100644
--- a/src/Module/Update/Profile.php
+++ b/src/Module/Update/Profile.php
@@ -81,11 +81,11 @@ class Profile extends BaseModule
 		}
 
 		$items_stmt = DBA::p(
-			"SELECT DISTINCT(`parent-uri-id`) AS `uri-id`, MAX(`created`), MAX(`received`) FROM `post-user-view`
+			"SELECT `parent-uri-id` AS `uri-id`, MAX(`created`), MAX(`received`) FROM `post-user-view`
 				WHERE `uid` = ? AND NOT `contact-blocked` AND NOT `contact-pending`
 				AND `visible` AND (NOT `deleted` OR `gravity` = ?)
 				AND `wall` $sql_extra4 $sql_extra
-			ORDER BY `received` DESC",
+			GROUP BY `parent-uri-id` ORDER BY `received` DESC",
 			$a->profile['uid'],
 			GRAVITY_ACTIVITY
 		);