mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix: make preload custom proterties sharding compatible
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
b21a399d1a
commit
1363e142d8
1 changed files with 9 additions and 9 deletions
|
|
@ -364,16 +364,16 @@ class CustomPropertiesBackend implements BackendInterface {
|
|||
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 = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue