@@ -310,11 +310,12 @@ 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 ' )));
313317 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+ $ qb ->setParameter ('fileIds ' , $ chunk , IQueryBuilder::PARAM_INT_ARRAY );
318319 $ rows = $ qb ->runAcrossAllShards ()
319320 ->executeQuery ();
320321 while ($ row = $ rows ->fetchAssociative ()) {
@@ -336,11 +337,12 @@ 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 ' )));
339344 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 )));
345+ $ qb ->setParameter ('pathHashes ' , $ chunk , IQueryBuilder::PARAM_STR_ARRAY );
344346 $ rows = $ qb ->runAcrossAllShards ()
345347 ->executeQuery ();
346348 while ($ row = $ rows ->fetchAssociative ()) {
0 commit comments