From cc36cc3f3fd134a0726f2f74a50cc98afd454e98 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 Aug 2020 08:57:06 +0200 Subject: [PATCH] Don't use SELECT DISTINCT when to_char() is used in a WHERE statement Nice bug in Oracle Signed-off-by: Joas Schilling --- apps/workflowengine/lib/Manager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index 1fc30001518..5bb9704e291 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -147,10 +147,10 @@ class Manager implements IManager { 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 = []; -- 2.39.5