Merge pull request #22469 from nextcloud/bugfix/noid/oracle-casting-select-distinct

Don't use SELECT DISTINCT when to_char() is used in a WHERE statement
This commit is contained in:
Joas Schilling 2020-09-08 09:40:11 +02:00 committed by GitHub
commit 6540c397aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View 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 = [];