#106579"Prepared statement contains too many placeholders" on reference index update
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.