[BUGFIX] Prepared statement contains too many placeholders 05/54805/2
authorPawel Cieslik <p.cieslik@macopedia.pl>
Mon, 27 Nov 2017 19:06:31 +0000 (20:06 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Mon, 27 Nov 2017 21:51:45 +0000 (22:51 +0100)
Fix method findInStorageAndNotInUidList where $uidList
contains more then 65536 records in MySQL, 64000 in Oracle,
34464 in PostgreSQL by avoiding using prepared statements
and just passing values directly in query.

Resolves: #82233
Releases: master, 8.7
Change-Id: Ic72fa540936631274ae542d3c02128e159bd3fb1
Reviewed-on: https://review.typo3.org/54805
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php

index 56ac3e7..d1f20c8 100644 (file)
@@ -456,7 +456,7 @@ class FileIndexRepository implements SingletonInterface
      * Helper function for the Indexer to detect missing files
      *
      * @param ResourceStorage $storage
-     * @param array $uidList
+     * @param int[] $uidList
      * @return array
      */
     public function findInStorageAndNotInUidList(ResourceStorage $storage, array $uidList)
@@ -477,7 +477,7 @@ class FileIndexRepository implements SingletonInterface
             $queryBuilder->andWhere(
                 $queryBuilder->expr()->notIn(
                     'uid',
-                    $queryBuilder->createNamedParameter($uidList, Connection::PARAM_INT_ARRAY)
+                    array_map('intval', $uidList)
                 )
             );
         }