optimize calendar search query

see https://github.com/nextcloud/calendar/issues/4758

Signed-off-by: Jamie McClelland <jm@mayfirst.org>
This commit is contained in:
Jamie McClelland 2023-08-07 10:49:13 -04:00 committed by backportbot-nextcloud[bot]
parent 8ec206d4c5
commit a1e9b90433

View file

@ -1839,7 +1839,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
// only return public items for shared calendars for now
if (isset($calendarInfo['{http://owncloud.org/ns}owner-principal']) === false || $calendarInfo['principaluri'] !== $calendarInfo['{http://owncloud.org/ns}owner-principal']) {
$innerQuery->andWhere($innerQuery->expr()->eq('c.classification',
$outerQuery->andWhere($outerQuery->expr()->eq('c.classification',
$outerQuery->createNamedParameter(self::CLASSIFICATION_PUBLIC)));
}