@@ -86,6 +86,7 @@ private function setupFileCache(): void {
8686 'storage_id ' => $ query ->createNamedParameter (1001001 , IQueryBuilder::PARAM_INT ),
8787 'user_id ' => $ query ->createNamedParameter ('partitioned_test ' ),
8888 'mount_point ' => $ query ->createNamedParameter ('/mount/point ' ),
89+ 'mount_point_hash ' => $ query ->createNamedParameter (hash ('xxh128 ' , '/mount/point ' )),
8990 'mount_provider_class ' => $ query ->createNamedParameter ('test ' ),
9091 'root_id ' => $ query ->createNamedParameter ($ fileId , IQueryBuilder::PARAM_INT ),
9192 ]);
@@ -134,7 +135,7 @@ public function testSimplePartitionedQuery(): void {
134135 $ builder ->addPartition (new PartitionSplit ('filecache ' , ['filecache ' ]));
135136
136137 // query borrowed from UserMountCache
137- $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_id ' , 'f.path ' , 'mount_provider_class ' )
138+ $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_point_hash ' , ' mount_id ' , 'f.path ' , 'mount_provider_class ' )
138139 ->from ('mounts ' , 'm ' )
139140 ->innerJoin ('m ' , 'filecache ' , 'f ' , $ builder ->expr ()->eq ('m.root_id ' , 'f.fileid ' ))
140141 ->where ($ builder ->expr ()->eq ('storage_id ' , $ builder ->createNamedParameter (1001001 , IQueryBuilder::PARAM_INT )));
@@ -147,6 +148,7 @@ public function testSimplePartitionedQuery(): void {
147148 $ this ->assertCount (1 , $ results );
148149 $ this ->assertEquals ($ results [0 ]['user_id ' ], 'partitioned_test ' );
149150 $ this ->assertEquals ($ results [0 ]['mount_point ' ], '/mount/point ' );
151+ $ this ->assertEquals ($ results [0 ]['mount_point_hash ' ], hash ('xxh128 ' , '/mount/point ' ));
150152 $ this ->assertEquals ($ results [0 ]['mount_provider_class ' ], 'test ' );
151153 $ this ->assertEquals ($ results [0 ]['path ' ], 'file1 ' );
152154 }
@@ -155,7 +157,7 @@ public function testMultiTablePartitionedQuery(): void {
155157 $ builder = $ this ->getQueryBuilder ();
156158 $ builder ->addPartition (new PartitionSplit ('filecache ' , ['filecache ' , 'filecache_extended ' ]));
157159
158- $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_id ' , 'f.path ' , 'mount_provider_class ' , 'fe.upload_time ' )
160+ $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_point_hash ' , ' mount_id ' , 'f.path ' , 'mount_provider_class ' , 'fe.upload_time ' )
159161 ->from ('mounts ' , 'm ' )
160162 ->innerJoin ('m ' , 'filecache ' , 'f ' , $ builder ->expr ()->eq ('m.root_id ' , 'f.fileid ' ))
161163 ->innerJoin ('f ' , 'filecache_extended ' , 'fe ' , $ builder ->expr ()->eq ('f.fileid ' , 'fe.fileid ' ))
@@ -169,6 +171,7 @@ public function testMultiTablePartitionedQuery(): void {
169171 $ this ->assertCount (1 , $ results );
170172 $ this ->assertEquals ($ results [0 ]['user_id ' ], 'partitioned_test ' );
171173 $ this ->assertEquals ($ results [0 ]['mount_point ' ], '/mount/point ' );
174+ $ this ->assertEquals ($ results [0 ]['mount_point_hash ' ], hash ('xxh128 ' , '/mount/point ' ));
172175 $ this ->assertEquals ($ results [0 ]['mount_provider_class ' ], 'test ' );
173176 $ this ->assertEquals ($ results [0 ]['path ' ], 'file1 ' );
174177 $ this ->assertEquals ($ results [0 ]['upload_time ' ], 1234 );
@@ -178,7 +181,7 @@ public function testPartitionedQueryFromSplit(): void {
178181 $ builder = $ this ->getQueryBuilder ();
179182 $ builder ->addPartition (new PartitionSplit ('filecache ' , ['filecache ' ]));
180183
181- $ query = $ builder ->select ('storage ' , 'm.root_id ' , 'm.user_id ' , 'm.mount_point ' , 'm.mount_id ' , 'path ' , 'm.mount_provider_class ' )
184+ $ query = $ builder ->select ('storage ' , 'm.root_id ' , 'm.user_id ' , 'm.mount_point ' , 'm.mount_point_hash ' , ' m. mount_id ' , 'path ' , 'm.mount_provider_class ' )
182185 ->from ('filecache ' , 'f ' )
183186 ->innerJoin ('f ' , 'mounts ' , 'm ' , $ builder ->expr ()->eq ('m.root_id ' , 'f.fileid ' ));
184187 $ query ->where ($ builder ->expr ()->eq ('storage ' , $ builder ->createNamedParameter (1001001 , IQueryBuilder::PARAM_INT )));
@@ -191,6 +194,7 @@ public function testPartitionedQueryFromSplit(): void {
191194 $ this ->assertCount (1 , $ results );
192195 $ this ->assertEquals ($ results [0 ]['user_id ' ], 'partitioned_test ' );
193196 $ this ->assertEquals ($ results [0 ]['mount_point ' ], '/mount/point ' );
197+ $ this ->assertEquals ($ results [0 ]['mount_point_hash ' ], hash ('xxh128 ' , '/mount/point ' ));
194198 $ this ->assertEquals ($ results [0 ]['mount_provider_class ' ], 'test ' );
195199 $ this ->assertEquals ($ results [0 ]['path ' ], 'file1 ' );
196200 }
@@ -200,7 +204,7 @@ public function testMultiJoinPartitionedQuery(): void {
200204 $ builder ->addPartition (new PartitionSplit ('filecache ' , ['filecache ' ]));
201205
202206 // query borrowed from UserMountCache
203- $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_id ' , 'f.path ' , 'mount_provider_class ' )
207+ $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_point_hash ' , ' mount_id ' , 'f.path ' , 'mount_provider_class ' )
204208 ->selectAlias ('s.id ' , 'storage_string_id ' )
205209 ->from ('mounts ' , 'm ' )
206210 ->innerJoin ('m ' , 'filecache ' , 'f ' , $ builder ->expr ()->eq ('m.root_id ' , 'f.fileid ' ))
@@ -215,6 +219,7 @@ public function testMultiJoinPartitionedQuery(): void {
215219 $ this ->assertCount (1 , $ results );
216220 $ this ->assertEquals ($ results [0 ]['user_id ' ], 'partitioned_test ' );
217221 $ this ->assertEquals ($ results [0 ]['mount_point ' ], '/mount/point ' );
222+ $ this ->assertEquals ($ results [0 ]['mount_point_hash ' ], hash ('xxh128 ' , '/mount/point ' ));
218223 $ this ->assertEquals ($ results [0 ]['mount_provider_class ' ], 'test ' );
219224 $ this ->assertEquals ($ results [0 ]['path ' ], 'file1 ' );
220225 $ this ->assertEquals ($ results [0 ]['storage_string_id ' ], 'test1 ' );
0 commit comments