[web-bugs] master: Group by needs to specifically reference a column name, not a variable.
| From: | Danack via Nikita Popov | Date: | Thu, 21 Oct 2021 09:19:09 +0000 |
| Subject: | [web-bugs] master: Group by needs to specifically reference a column name, not a variable. | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-29662@lists.php.net to get a copy of this message | ||
Author: Danack (Danack)
Committer: Nikita Popov (nikic)
Date: 2021-10-21T11:19:46+02:00
Commit: https://github.com/php/web-bugs/commit/49be135fd809a72746539cea56d9221d01c860ad
Raw diff: https://github.com/php/web-bugs/commit/49be135fd809a72746539cea56d9221d01c860ad.diff
Group by needs to specifically reference a column name, not a variable.
Changed paths:
M src/Repository/BugRepository.php
Diff:
diff --git a/src/Repository/BugRepository.php b/src/Repository/BugRepository.php
index 8bb871fb..dadbb997 100644
--- a/src/Repository/BugRepository.php
+++ b/src/Repository/BugRepository.php
@@ -45,7 +45,7 @@ public function findOneById(int $id): array
FROM bugdb b
LEFT JOIN bugdb_votes ON b.id = bug
WHERE b.id = ?
- GROUP BY bug
+ GROUP BY b.id
';
$statement = $this->dbh->prepare($sql);