From a3367ca81e8c59f5c45ebde62fb67f8fa71b40c9 Mon Sep 17 00:00:00 2001
From: Sascha Egerer <sascha@sascha-egerer.de>
Date: Wed, 13 Jun 2018 21:18:30 +0200
Subject: [PATCH] [BUGFIX] Do not use named parameter for list of orphan
 records ids

The OrphanRecordsCommand fetches records by a list of ids.
This list can get very big so the database will fail if the
number of placesholders exceeds its limit.

Resolves: #85257
Related: #80875
Releases: master, 8.7
Change-Id: Ia6b9398f4e54157301abb57fac5adb7f51130907
Reviewed-on: https://review.typo3.org/57213
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Thomas Rawiel <thomas.rawiel@gmail.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
---
 typo3/sysext/lowlevel/Classes/Command/OrphanRecordsCommand.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/lowlevel/Classes/Command/OrphanRecordsCommand.php b/typo3/sysext/lowlevel/Classes/Command/OrphanRecordsCommand.php
index ce924bd08023..bccab3ae8367 100644
--- a/typo3/sysext/lowlevel/Classes/Command/OrphanRecordsCommand.php
+++ b/typo3/sysext/lowlevel/Classes/Command/OrphanRecordsCommand.php
@@ -102,7 +102,8 @@ Manual repair suggestions:
                 ->where(
                     $queryBuilder->expr()->notIn(
                         'uid',
-                        $queryBuilder->createNamedParameter($idList, Connection::PARAM_INT_ARRAY)
+                        // do not use named parameter here as the list can get too long
+                        array_map('intval', $idList)
                     )
                 )
                 ->orderBy('uid')
-- 
GitLab