88753[BUGFIX] Fix COUNT(*) issue with GROUP BY and HAVING in Extbase QueryBuilder
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 4
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/53/88753/4 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/53/88753/4 && git cherry-pick FETCH_HEAD
Review
-
Code review CR -1 Needs a vote
- Stefan Froemken -1
-
Verified V 0 Needs a vote
- core-ci +1 CI
Issues 1
Files 1
Review log 1014
-
Stefan Froemken uploaded patch set 1 03/25/25, 16:43
-
core-ci voted on patch set 1 V -1 03/25/25, 16:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76296
-
Stefan Froemken uploaded patch set 2
V -103/25/25, 17:39 -
core-ci voted on patch set 2 V -1 03/25/25, 17:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76298
-
Garvin Hicking commented on patch set 2 03/25/25, 18:38
-
Stefan Froemken uploaded patch set 3
V -103/25/25, 21:38 -
Stefan Froemken uploaded patch set 4 03/25/25, 21:40
-
core-ci voted on patch set 3 V -1 03/25/25, 21:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76319
-
core-ci voted on patch set 4 V +1 03/25/25, 21:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76320
-
Stefan Froemken commented on patch set 4 CR -1 03/25/25, 22:00
Yes, it's green. BUT! Please do NOT merge!!! I t just solves the issue for just Extbase Queries which are converted to Doctrine Query. For self builded Doctrine Queries this solution does NOT work, so it does not solve the related issue just right now. Maybe it needs some more tests. Further we should stop working with TABLE.*, which makes various problems when using query as subquery. For two tests I got "duplicate column 'sorting'". That was solved with my current patch. To solve this patch for Extbase queries and also for own Doctrine queries we had to parse the SELECT part and only replace all TABLE.* to individual columnname lists. That way we have to find a solution to just keep the last duplicate columnname value. But parsing SELECT with RegExp is nasty. I think I will ask Stefan Bürk how we/I can start solcing this. -
Simon Schaufelberger commented on patch set 4 03/25/25, 23:03
Typo3DbBackend.php:403Unresolveddatatype for col missing -
Garvin Hicking commented on patch set 4 03/26/25, 07:36
Reply
I was thinking right now: if a "select count(*) from (subquery)" is used, doesn't that mean that the DB engine actually returns all the data in the subquery and only then counts it? that might cause bad performance because for large tables all data would (internally) be returned? -
Stefan Bürk commented on patch set 4 03/26/25, 09:23
Reply Unresolved
The DB engine has to compute the full result anyway to do a count. If you use count() directly or on a sub-query. In case you have an query which fully works on indexes, only than you have a performeance difference as it could not do the count on the indexes only. In real world, special within extbase that should not be happen so often and not be an issue here. Not saying the change is okay - need a deeper look. -
Benni Mack marked it work in progress 03/27/25, 17:37
Typo3DbBackend.php:338Unresolved