@@ -87,6 +87,7 @@ private function setupFileCache(): void {
8787 'storage_id ' => $ query ->createNamedParameter (1001001 , IQueryBuilder::PARAM_INT ),
8888 'user_id ' => $ query ->createNamedParameter ('partitioned_test ' ),
8989 'mount_point ' => $ query ->createNamedParameter ('/mount/point ' ),
90+ 'mount_point_hash ' => $ query ->createNamedParameter (hash ('xxh128 ' , '/mount/point ' )),
9091 'mount_provider_class ' => $ query ->createNamedParameter ('test ' ),
9192 'root_id ' => $ query ->createNamedParameter ($ fileId , IQueryBuilder::PARAM_INT ),
9293 ]);
@@ -135,7 +136,7 @@ public function testSimplePartitionedQuery(): void {
135136 $ builder ->addPartition (new PartitionSplit ('filecache ' , ['filecache ' ]));
136137
137138 // query borrowed from UserMountCache
138- $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_id ' , 'f.path ' , 'mount_provider_class ' )
139+ $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_point_hash ' , ' mount_id ' , 'f.path ' , 'mount_provider_class ' )
139140 ->from ('mounts ' , 'm ' )
140141 ->innerJoin ('m ' , 'filecache ' , 'f ' , $ builder ->expr ()->eq ('m.root_id ' , 'f.fileid ' ))
141142 ->where ($ builder ->expr ()->eq ('storage_id ' , $ builder ->createNamedParameter (1001001 , IQueryBuilder::PARAM_INT )));
@@ -148,6 +149,7 @@ public function testSimplePartitionedQuery(): void {
148149 $ this ->assertCount (1 , $ results );
149150 $ this ->assertEquals ($ results [0 ]['user_id ' ], 'partitioned_test ' );
150151 $ this ->assertEquals ($ results [0 ]['mount_point ' ], '/mount/point ' );
152+ $ this ->assertEquals ($ results [0 ]['mount_point_hash ' ], hash ('xxh128 ' , '/mount/point ' ));
151153 $ this ->assertEquals ($ results [0 ]['mount_provider_class ' ], 'test ' );
152154 $ this ->assertEquals ($ results [0 ]['path ' ], 'file1 ' );
153155 }
@@ -156,7 +158,7 @@ public function testMultiTablePartitionedQuery(): void {
156158 $ builder = $ this ->getQueryBuilder ();
157159 $ builder ->addPartition (new PartitionSplit ('filecache ' , ['filecache ' , 'filecache_extended ' ]));
158160
159- $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_id ' , 'f.path ' , 'mount_provider_class ' , 'fe.upload_time ' )
161+ $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_point_hash ' , ' mount_id ' , 'f.path ' , 'mount_provider_class ' , 'fe.upload_time ' )
160162 ->from ('mounts ' , 'm ' )
161163 ->innerJoin ('m ' , 'filecache ' , 'f ' , $ builder ->expr ()->eq ('m.root_id ' , 'f.fileid ' ))
162164 ->innerJoin ('f ' , 'filecache_extended ' , 'fe ' , $ builder ->expr ()->eq ('f.fileid ' , 'fe.fileid ' ))
@@ -170,6 +172,7 @@ public function testMultiTablePartitionedQuery(): void {
170172 $ this ->assertCount (1 , $ results );
171173 $ this ->assertEquals ($ results [0 ]['user_id ' ], 'partitioned_test ' );
172174 $ this ->assertEquals ($ results [0 ]['mount_point ' ], '/mount/point ' );
175+ $ this ->assertEquals ($ results [0 ]['mount_point_hash ' ], hash ('xxh128 ' , '/mount/point ' ));
173176 $ this ->assertEquals ($ results [0 ]['mount_provider_class ' ], 'test ' );
174177 $ this ->assertEquals ($ results [0 ]['path ' ], 'file1 ' );
175178 $ this ->assertEquals ($ results [0 ]['upload_time ' ], 1234 );
@@ -179,7 +182,7 @@ public function testPartitionedQueryFromSplit(): void {
179182 $ builder = $ this ->getQueryBuilder ();
180183 $ builder ->addPartition (new PartitionSplit ('filecache ' , ['filecache ' ]));
181184
182- $ query = $ builder ->select ('storage ' , 'm.root_id ' , 'm.user_id ' , 'm.mount_point ' , 'm.mount_id ' , 'path ' , 'm.mount_provider_class ' )
185+ $ 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 ' )
183186 ->from ('filecache ' , 'f ' )
184187 ->innerJoin ('f ' , 'mounts ' , 'm ' , $ builder ->expr ()->eq ('m.root_id ' , 'f.fileid ' ));
185188 $ query ->where ($ builder ->expr ()->eq ('storage ' , $ builder ->createNamedParameter (1001001 , IQueryBuilder::PARAM_INT )));
@@ -192,6 +195,7 @@ public function testPartitionedQueryFromSplit(): void {
192195 $ this ->assertCount (1 , $ results );
193196 $ this ->assertEquals ($ results [0 ]['user_id ' ], 'partitioned_test ' );
194197 $ this ->assertEquals ($ results [0 ]['mount_point ' ], '/mount/point ' );
198+ $ this ->assertEquals ($ results [0 ]['mount_point_hash ' ], hash ('xxh128 ' , '/mount/point ' ));
195199 $ this ->assertEquals ($ results [0 ]['mount_provider_class ' ], 'test ' );
196200 $ this ->assertEquals ($ results [0 ]['path ' ], 'file1 ' );
197201 }
@@ -201,7 +205,7 @@ public function testMultiJoinPartitionedQuery(): void {
201205 $ builder ->addPartition (new PartitionSplit ('filecache ' , ['filecache ' ]));
202206
203207 // query borrowed from UserMountCache
204- $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_id ' , 'f.path ' , 'mount_provider_class ' )
208+ $ query = $ builder ->select ('storage_id ' , 'root_id ' , 'user_id ' , 'mount_point ' , 'mount_point_hash ' , ' mount_id ' , 'f.path ' , 'mount_provider_class ' )
205209 ->selectAlias ('s.id ' , 'storage_string_id ' )
206210 ->from ('mounts ' , 'm ' )
207211 ->innerJoin ('m ' , 'filecache ' , 'f ' , $ builder ->expr ()->eq ('m.root_id ' , 'f.fileid ' ))
@@ -216,6 +220,7 @@ public function testMultiJoinPartitionedQuery(): void {
216220 $ this ->assertCount (1 , $ results );
217221 $ this ->assertEquals ($ results [0 ]['user_id ' ], 'partitioned_test ' );
218222 $ this ->assertEquals ($ results [0 ]['mount_point ' ], '/mount/point ' );
223+ $ this ->assertEquals ($ results [0 ]['mount_point_hash ' ], hash ('xxh128 ' , '/mount/point ' ));
219224 $ this ->assertEquals ($ results [0 ]['mount_provider_class ' ], 'test ' );
220225 $ this ->assertEquals ($ results [0 ]['path ' ], 'file1 ' );
221226 $ this ->assertEquals ($ results [0 ]['storage_string_id ' ], 'test1 ' );
0 commit comments