Review 12.4 Merged

83532[BUGFIX] Ensure working count query in `DatabaseRecordList::getTable()`

Stefan Bürk CR +2 V +2 Easy +8 −1 updated 04/08/24, 09:46

Commit message

`\TYPO3\CMS\Backend\RecordList\DatabaseRecordList` provides the ability
to modify the QueryBuilder used for the record list representation with
the PSR-14 `ModifyDatabaseQueryForRecordListingEvent`, after generic
query information like default orderings and similar have been added.

That is covered within the `getQueryBuilder()` method, which is used in
other class methods, for example in `getTables()` where it is changed
to a `COUNT()` query.

MariaDB for example is picky about count queries using `order by`,
`group by` or aggregation methods which are not reflected or added
in the counter parts leading to a not so useful error like

  Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP
  columns is illegal if there is no GROUP BY clause

or similar variants. This error message can be missleading for the
case a order by has been used along with a COUNT() query.

Listener of the event do not get the information if order-by can
be added or should be left out, therefore maybe adding sorting
conditions for a count query.

This change now resets any order statements for the count-query
like other places in the TYPO3 core.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 813

  1. Stefan Bürk commented on patch set 1 03/19/24, 14:20

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V -1 03/19/24, 14:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54698

  3. Stefan Bürk uploaded patch set 2 V -1 03/19/24, 14:52

  4. core-ci voted on patch set 2 V -1 03/19/24, 15:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54699

  5. Stefan Bürk uploaded patch set 3 V -1 03/27/24, 10:39

  6. core-ci voted on patch set 3 V -1 03/27/24, 10:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54992

  7. Stefan Bürk uploaded patch set 4 V -1 03/27/24, 11:05

  8. core-ci voted on patch set 4 V +1 03/27/24, 11:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54995

  9. Stefan Bürk uploaded patch set 5 V +1 03/27/24, 13:39

  10. core-ci voted on patch set 5 V +1 03/27/24, 13:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54999

  11. Garvin Hicking voted on patch set 5 CR +1 V +1 04/04/24, 15:18

  12. Stefan Bürk voted on patch set 5 CR +2 V +2 04/08/24, 09:46

  13. Stefan Bürk merged patch set 6 04/08/24, 09:46