]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't use SELECT DISTINCT when to_char() is used in a WHERE statement 22721/head
authorJoas Schilling <coding@schilljs.com>
Fri, 28 Aug 2020 06:57:06 +0000 (08:57 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 8 Sep 2020 07:44:10 +0000 (07:44 +0000)
Nice bug in Oracle

Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/workflowengine/lib/Manager.php

index 1fc300015180179bbd6328dc7f203953784196ef..5bb9704e291be0fffe692c88e64a1442e1bd676e 100644 (file)
@@ -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 = [];