Review 11.5 Merged

86551[BUGFIX] Mitigate invalid `count` query in `PageInformationController`

Stefan Bürk CR +2 V +2 Hard +353 −1 updated 10/10/24, 18:58

Commit message

Database systems like postgresql require to have all `ORDER BY` or
`GROUP BY` columns also specified in `SELECT` specifier list.

That means: Whenever a database query is composed using the
`QueryBuilder` API to create a basic `SELECT` query with corresponding
ordering or grouping definitions, a derived count query needs to take
extra care to properly remove ordering and grouping definitions.
Actually they do not make any sense in count queries anyway, so removing
them does not harm anyway.

This change clones the created `QueryBuilder` before executing the
select query and removes ordering definitions before reusing it to
initiate a count operation.

The query is now covered with a functional test, currently testing the
controller. That is mainly done to preserve easier backporting of this
bugfix and extract database query or buildup into a dedicated testable
service later.

Review

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

Issues 1

Files 5

Review log 46

  1. Stefan Bürk uploaded patch set 1 10/10/24, 17:49

  2. core-ci voted on patch set 1 V -1 10/10/24, 18:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67529

  3. Stefan Bürk uploaded patch set 2 V -1 10/10/24, 18:04

  4. core-ci voted on patch set 2 V +1 10/10/24, 18:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67530

  5. Stefan Bürk voted on patch set 2 CR +2 V +2 10/10/24, 18:58

  6. Stefan Bürk merged patch set 3 10/10/24, 18:58