Issue Bug Closed

#106579"Prepared statement contains too many placeholders" on reference index update

Oliver Heins 04/16/25, 12:20 updated 12/02/25, 14:21

Description

I ran into a Doctrine\DBAL\Exception\DriverException “An exception occurred while executing a query: Prepared statement contains too many placeholders” while updating an existing project. It happened on saving a new data set leaving the system unmaintainable.

The cause was that the reference index was not up-to-date and an attempt was made to update it when the data record was saved. However, as > 3000 entries were to be added for a single record, the method TYPO3\CMS\Core\Database\Connection::bulkInsert() failed.

This type of error occurs relatively frequently, as a search shows: https://forge.typo3.org/projects/typo3cms-core/search?utf8=%E2%9C%93&scope=subprojects&issues=1&q=Prepared+statement+contains+too+many+placeholders

Since the number of permitted prepared statements differs depending on the database used, I believe that the request should be split centrally and not be handled by each individual call itself.

Reviews 2

History 49

  1. Oliver Heins commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-04-16T20:05:10+00:00" > 04/16/25, 20:05 </span>

    Applied in changeset commit:23d2006be0ef3fe4f770bcedb336db65eeafc90d.