[BUGFIX] Avoid unreliable 'rowCount()' in IndexSearchRepository
rowCount() on result sets for SELECT queries are not reliable across all DBMS, which doctrine/dbal comments in the docblock. See: https://github.com/doctrine/dbal/blob/110ab13/src/Driver/Result.php#L77 Because of "rowCount()"'s unreliable behaviour for some dbms like sqlite, this should be avoided to ensure cross dbms support. '\TYPO3\CMS\IndexedSearch\Domain\Repository\IndexSearchRepository' uses 'rowCount()' in 'doSearch()' which fails on sqlite, making it impossible to get any result in the frontend search. Doing a count() query as replacement is not possible and needs a bigger architectural change, which is not feasable as bugfix. Thus fallback to retrieve the result into an array and counting the array is used as a intermediate solution to ensure index_search is working across all supported database systems. The architectural change will be done in a dedicated patch. Resolves: #97460 Releases: main, 11.5 Change-Id: Id7afa9f95fefbba07acb7c0dda1267dd2fce92db Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74380 Tested-by:core-ci <typo3@b13.com> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Oliver Bartsch <bo@cedev.de> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Oliver Bartsch <bo@cedev.de>
Please register or sign in to comment