Merge pull request #24791 from nextcloud/backport/24715/stable20

[stable20] Limit getIncomplete query to one row
This commit is contained in:
Roeland Jago Douma 2020-12-21 10:32:28 +01:00 committed by GitHub
commit 2a91d7837b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -972,7 +972,8 @@ class Cache implements ICache {
->from('filecache') ->from('filecache')
->whereStorageId() ->whereStorageId()
->andWhere($query->expr()->lt('size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))) ->andWhere($query->expr()->lt('size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)))
->orderBy('fileid', 'DESC'); ->orderBy('fileid', 'DESC')
->setMaxResults(1);
$result = $query->execute(); $result = $query->execute();
$path = $result->fetchColumn(); $path = $result->fetchColumn();