Skip to content
Snippets Groups Projects
Commit 68f1f4a8 authored by Stefan Bürk's avatar Stefan Bürk Committed by Oliver Bartsch
Browse files

[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: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent 6f7514f5
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment