Bug #85257

Bug #80875: Multiple problems with relation handler if too many records exist on a page

OrphanRecordsCommand fails if list of ids is too long

Added by Sascha Egerer over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2018-06-13
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Thomas Rawiel wrote:

Sascha, here is the requested stack trace,
when running
./typo3cms cleanup:orphanrecords -vvv via CLI
(TYPO3 8.7.16)

[ Doctrine\DBAL\Exception\DriverException ]      
 An exception occurred while executing 'SELECT `uid` FROM `tx_dmdeveloperlog_domain_model_logentry` WHERE `uid` NOT IN (?, ###ABOUT 140000 Placeholders###, ?) ORDER BY `uid` ASC' with params [###LIST-OF-IDs###]:  

 Prepared statement contains too many placeholders  

Exception trace:
#0 ()
  /var/www/src/typo3_src-8.7.16/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115
#1 Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException()
  /var/www/src/typo3_src-8.7.16/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128
#2 Doctrine\DBAL\DBALException::driverExceptionDuringQuery()
  /var/www/src/typo3_src-8.7.16/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:855
#3 Doctrine\DBAL\Connection->executeQuery()
  /var/www/src/typo3_src-8.7.16/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:206
#4 Doctrine\DBAL\Query\QueryBuilder->execute()
  typo3/sysext/core/Classes/Database/Query/QueryBuilder.php:187
#5 TYPO3\CMS\Core\Database\Query\QueryBuilder->execute()
  typo3/sysext/lowlevel/Classes/Command/OrphanRecordsCommand.php:109
#6 TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand->execute()
  typo3conf/ext/typo3_console/Libraries/symfony-process.phar/vendor/symfony/console/Command/Command.php:252
#7 Symfony\Component\Console\Command\Command->run()
  typo3conf/ext/typo3_console/Libraries/symfony-process.phar/vendor/symfony/console/Application.php:946
#8 Symfony\Component\Console\Application->doRunCommand()
  typo3conf/ext/typo3_console/Libraries/symfony-process.phar/vendor/symfony/console/Application.php:248
#9 Symfony\Component\Console\Application->doRun()
  typo3conf/ext/typo3_console/Libraries/symfony-process.phar/vendor/symfony/console/Application.php:148
#10 Symfony\Component\Console\Application->run()
  typo3conf/ext/typo3_console/Classes/Console/Core/Kernel.php:162
#11 Helhum\Typo3Console\Core\Kernel->handle()
  typo3conf/ext/typo3_console/Scripts/typo3-console.php:19
#12 {closure}()
  typo3conf/ext/typo3_console/Scripts/typo3-console.php:21
#13 require()
  typo3cms:18

Caused by:

 [ Doctrine\DBAL\Driver\Mysqli\MysqliException ]
 Prepared statement contains too many placeholders

Exception trace:
#0 ()
  /var/www/src/typo3_src-8.7.16/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:94
#1 Doctrine\DBAL\Driver\Mysqli\MysqliStatement->__construct()
  /var/www/src/typo3_src-8.7.16/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php:120
#2 Doctrine\DBAL\Driver\Mysqli\MysqliConnection->prepare()
  /var/www/src/typo3_src-8.7.16/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:844
#3 Doctrine\DBAL\Connection->executeQuery()
  /var/www/src/typo3_src-8.7.16/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:206
#4 Doctrine\DBAL\Query\QueryBuilder->execute()
  typo3/sysext/core/Classes/Database/Query/QueryBuilder.php:187
#5 TYPO3\CMS\Core\Database\Query\QueryBuilder->execute()
  typo3/sysext/lowlevel/Classes/Command/OrphanRecordsCommand.php:109
#6 TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand->execute()
  typo3conf/ext/typo3_console/Libraries/symfony-process.phar/vendor/symfony/console/Command/Command.php:252
#7 Symfony\Component\Console\Command\Command->run()
  typo3conf/ext/typo3_console/Libraries/symfony-process.phar/vendor/symfony/console/Application.php:946
#8 Symfony\Component\Console\Application->doRunCommand()
  typo3conf/ext/typo3_console/Libraries/symfony-process.phar/vendor/symfony/console/Application.php:248
#9 Symfony\Component\Console\Application->doRun()
  typo3conf/ext/typo3_console/Libraries/symfony-process.phar/vendor/symfony/console/Application.php:148
#10 Symfony\Component\Console\Application->run()
  typo3conf/ext/typo3_console/Classes/Console/Core/Kernel.php:162
#11 Helhum\Typo3Console\Core\Kernel->handle()
  typo3conf/ext/typo3_console/Scripts/typo3-console.php:19
#12 {closure}()
  typo3conf/ext/typo3_console/Scripts/typo3-console.php:21
#13 require()
  typo3cms:18

cleanup:orphanrecords [--dry-run]

Associated revisions

Revision a3367ca8 (diff)
Added by Sascha Egerer over 1 year ago

[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 <>
Tested-by: Thomas Rawiel <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision e2e07114 (diff)
Added by Sascha Egerer over 1 year ago

[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/57230
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57213

#2 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57230

#3 Updated by Sascha Egerer over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF