@@ -310,13 +310,14 @@ private function fetchFilecacheByFileIds(array $fileIds): array {
310310 }
311311
312312 $ result = [];
313+ $ qb = $ this ->connection ->getTypedQueryBuilder ();
314+ $ qb ->selectColumns ('fileid ' , 'storage ' , 'etag ' , 'mimetype ' )
315+ ->from ('filecache ' )
316+ ->where ($ qb ->expr ()->in ('fileid ' , $ qb ->createParameter ('fileIds ' )))
317+ ->runAcrossAllShards ();
313318 foreach (array_chunk ($ fileIds , 1000 ) as $ chunk ) {
314- $ qb = $ this ->connection ->getTypedQueryBuilder ();
315- $ qb ->selectColumns ('fileid ' , 'storage ' , 'etag ' , 'mimetype ' )
316- ->from ('filecache ' )
317- ->where ($ qb ->expr ()->in ('fileid ' , $ qb ->createNamedParameter ($ chunk , IQueryBuilder::PARAM_INT_ARRAY )));
318- $ rows = $ qb ->runAcrossAllShards ()
319- ->executeQuery ();
319+ $ qb ->setParameter ('fileIds ' , $ chunk , IQueryBuilder::PARAM_INT_ARRAY );
320+ $ rows = $ qb ->executeQuery ();
320321 while ($ row = $ rows ->fetchAssociative ()) {
321322 $ result [(int )$ row ['fileid ' ]] = $ row ;
322323 }
@@ -336,13 +337,14 @@ private function fetchFilecacheByPathHashes(array $pathHashes): array {
336337 }
337338
338339 $ result = [];
340+ $ qb = $ this ->connection ->getTypedQueryBuilder ();
341+ $ qb ->selectColumns ('fileid ' , 'storage ' , 'etag ' , 'mimetype ' , 'parent ' , 'path_hash ' )
342+ ->from ('filecache ' )
343+ ->where ($ qb ->expr ()->in ('path_hash ' , $ qb ->createParameter ('pathHashes ' )))
344+ ->runAcrossAllShards ();
339345 foreach (array_chunk ($ pathHashes , 1000 ) as $ chunk ) {
340- $ qb = $ this ->connection ->getTypedQueryBuilder ();
341- $ qb ->selectColumns ('fileid ' , 'storage ' , 'etag ' , 'mimetype ' , 'parent ' , 'path_hash ' )
342- ->from ('filecache ' )
343- ->where ($ qb ->expr ()->in ('path_hash ' , $ qb ->createNamedParameter ($ chunk , IQueryBuilder::PARAM_STR_ARRAY )));
344- $ rows = $ qb ->runAcrossAllShards ()
345- ->executeQuery ();
346+ $ qb ->setParameter ('pathHashes ' , $ chunk , IQueryBuilder::PARAM_STR_ARRAY );
347+ $ rows = $ qb ->executeQuery ();
346348 while ($ row = $ rows ->fetchAssociative ()) {
347349 $ result [$ row ['path_hash ' ]] = $ row ;
348350 }
0 commit comments