diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-09 22:09:40 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-14 13:30:22 +0200 |
commit | 047cf5de078a3441b88ca0757a6e842aaf6922a9 (patch) | |
tree | f404d237393bae530fed10b273605558ef02ed14 /lib/private/Preview | |
parent | 362e6b29038ae43d65114062c254774bc3b64803 (diff) | |
download | nextcloud-server-047cf5de078a3441b88ca0757a6e842aaf6922a9.tar.gz nextcloud-server-047cf5de078a3441b88ca0757a6e842aaf6922a9.zip |
Move to join
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Preview')
-rw-r--r-- | lib/private/Preview/BackgroundCleanupJob.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index 1e88c605caf..25bf354e28b 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -25,6 +25,7 @@ namespace OC\Preview; use OC\BackgroundJob\TimedJob; use OC\Files\AppData\Factory; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\IDBConnection; @@ -56,17 +57,16 @@ class BackgroundCleanupJob extends TimedJob { $previewFodlerId = $previews->getId(); - $qb2 = $this->connection->getQueryBuilder(); - $qb2->select('fileid') - ->from('filecache'); - $qb = $this->connection->getQueryBuilder(); - $qb->select('name') - ->from('filecache') + $qb->select('a.name') + ->from('filecache', 'a') + ->leftJoin('a', 'filecache', 'b', $qb->expr()->eq( + $qb->expr()->castColumn('a.name', IQueryBuilder::PARAM_INT), 'b.fileid' + )) ->where( - $qb->expr()->eq('parent', $qb->createNamedParameter($previewFodlerId)) + $qb->expr()->isNull('b.fileid') )->andWhere( - $qb->expr()->notIn('name', $qb->createFunction($qb2->getSQL())) + $qb->expr()->eq('a.parent', $qb->createNamedParameter($previewFodlerId)) ); if (!$this->isCLI) { |