Skip to content

Commit 4bd20a7

Browse files
committed
fix: make preload custom proterties sharding compatible
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 0d98de4 commit 4bd20a7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

apps/dav/lib/DAV/CustomPropertiesBackend.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,16 +364,16 @@ private function getPublishedProperties(string $path, array $requestedProperties
364364
private function cacheDirectory(string $path, Directory $node): void {
365365
$prefix = ltrim($path . '/', '/');
366366
$query = $this->connection->getQueryBuilder();
367-
$query->select('name', 'propertypath', 'propertyname', 'propertyvalue', 'valuetype')
367+
$query->select('name', 'p.propertypath', 'p.propertyname', 'p.propertyvalue', 'p.valuetype')
368368
->from('filecache', 'f')
369-
->leftJoin('f', 'properties', 'p', $query->expr()->andX(
370-
$query->expr()->eq('propertypath', $query->func()->concat(
371-
$query->createNamedParameter($prefix),
372-
'name'
373-
)),
374-
$query->expr()->eq('userid', $query->createNamedParameter($this->user->getUID()))
375-
))
376-
->where($query->expr()->eq('parent', $query->createNamedParameter($node->getInternalFileId(), IQueryBuilder::PARAM_INT)));
369+
->hintShardKey('storage', $node->getNode()->getMountPoint()->getNumericStorageId())
370+
->leftJoin('f', 'properties', 'p', $query->expr()->eq('p.propertypath', $query->func()->concat(
371+
$query->createNamedParameter($prefix),
372+
'f.name'
373+
)),
374+
)
375+
->where($query->expr()->eq('parent', $query->createNamedParameter($node->getInternalFileId(), IQueryBuilder::PARAM_INT)))
376+
->andWhere($query->expr()->eq('p.userid', $query->createNamedParameter($this->user->getUID())));
377377
$result = $query->executeQuery();
378378

379379
$propsByPath = [];

0 commit comments

Comments
 (0)