Skip to content

Commit

Permalink
fix: make preload custom proterties sharding compatible
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Aug 21, 2024
1 parent 6adafb0 commit 278147e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions apps/dav/lib/DAV/CustomPropertiesBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,16 +364,16 @@ private function getPublishedProperties(string $path, array $requestedProperties
private function cacheDirectory(string $path, Directory $node): void {
$prefix = ltrim($path . '/', '/');
$query = $this->connection->getQueryBuilder();
$query->select('name', 'propertypath', 'propertyname', 'propertyvalue', 'valuetype')
$query->select('name', 'p.propertypath', 'p.propertyname', 'p.propertyvalue', 'p.valuetype')
->from('filecache', 'f')
->leftJoin('f', 'properties', 'p', $query->expr()->andX(
$query->expr()->eq('propertypath', $query->func()->concat(
$query->createNamedParameter($prefix),
'name'
)),
$query->expr()->eq('userid', $query->createNamedParameter($this->user->getUID()))
))
->where($query->expr()->eq('parent', $query->createNamedParameter($node->getInternalFileId(), IQueryBuilder::PARAM_INT)));
->hintShardKey('storage', $node->getNode()->getMountPoint()->getNumericStorageId())
->leftJoin('f', 'properties', 'p', $query->expr()->eq('p.propertypath', $query->func()->concat(
$query->createNamedParameter($prefix),
'f.name'
)),
)
->where($query->expr()->eq('parent', $query->createNamedParameter($node->getInternalFileId(), IQueryBuilder::PARAM_INT)))
->andWhere($query->expr()->eq('p.userid', $query->createNamedParameter($this->user->getUID())));
$result = $query->executeQuery();

$propsByPath = [];
Expand Down

0 comments on commit 278147e

Please sign in to comment.