[BUGFIX] Extbase: Fix counting objects on joined tables
While it's normally fine to replace DISTINCT with GROUP BY when counting objects this results in a different resultset. The GROUP BY statement will have n rows with the count per grouped combination while the DISTINCT based query will have one row with the count of unique combinations. Use a COUNT(DISTINCT uid) to get the expected result. DISTINCT is supported on MySQL, PostgreSQL, Oracle and MSSQL Server. Change-Id: If3193113529f1bb01693dba39abccfe349f169b1 Resolves: #79330 Releases: master Reviewed-on: https://review.typo3.org/51320 Tested-by:TYPO3com <no-reply@typo3.com> Reviewed-by:
Manuel Selbach <manuel_selbach@yahoo.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php 14 additions, 5 deletions...se/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
- typo3/sysext/extbase/Tests/Functional/Persistence/CountTest.php 1 addition, 1 deletion...sysext/extbase/Tests/Functional/Persistence/CountTest.php
- typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/persons.xml 8 additions, 0 deletions...extbase/Tests/Functional/Persistence/Fixtures/persons.xml
- typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/tags-mm.xml 9 additions, 1 deletion...extbase/Tests/Functional/Persistence/Fixtures/tags-mm.xml
Please register or sign in to comment