Skip to content

Commit

Permalink
Merge pull request #22721 from nextcloud/backport/22469/stable18
Browse files Browse the repository at this point in the history
[stable18] Don't use SELECT DISTINCT when to_char() is used in a WHERE statement
  • Loading branch information
MorrisJobke authored Sep 9, 2020
2 parents a4824ba + cc36cc3 commit 510a7d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/workflowengine/lib/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ public function getRuleMatcher(): IRuleMatcher {
public function getAllConfiguredEvents() {
$query = $this->connection->getQueryBuilder();

$query->selectDistinct('class')
->addSelect('entity', 'events')
$query->select('class', 'entity', $query->expr()->castColumn('events', IQueryBuilder::PARAM_STR))
->from('flow_operations')
->where($query->expr()->neq('events', $query->createNamedParameter('[]'), IQueryBuilder::PARAM_STR));
->where($query->expr()->neq('events', $query->createNamedParameter('[]'), IQueryBuilder::PARAM_STR))
->groupBy('class', 'entity', $query->expr()->castColumn('events', IQueryBuilder::PARAM_STR));

$result = $query->execute();
$operations = [];
Expand Down

0 comments on commit 510a7d4

Please sign in to comment.