Skip to content
Snippets Groups Projects
Commit 0d6719c5 authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[BUGFIX] Provide CSP ReportRepository ONLY_FULL_GROUP_BY support

Some database systems like PostgresSQL and MySQL are really
picky if selected columns are not contained in all group and
order selections or no aggregation method is used
(aka 'ONLY_FULL_GROUP_BY').

That may be influenced by server configuration, which makes
it really hard to come up with a minmal grouping query if:

* not all used `ORDER BY` fields are included in
  the `GROUP BY` selection
* not all `GROUP BY` fields are contained in the
  `SELECT` field list
* Fields in the `SELECT` list are not included in
  the `GROUP BY` list OR using a aggregation function
  like `MAX()`, `MIN()`, `AVG(), `SUM()` and similar.

Aggregation function cannot be used for non numeric values like
`uuid like` strings and prevent to group on a field but retrieve
the uinique id (UUID, uid, ) of the `first` or  `last` record per
group in on query.

To get a similar effect through all database vendor and without
requiring specific, mostly not default database settings provided
by many hosting provider or in default configuration for databases,
this change introduces a nested inner join construct with to ensure
the same result across multiple systems.

Resolves: #101913
Releases: main, 12.4
Change-Id: I28fa36db46d8219fc67a5503509e2a92a71ea6a7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81015


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: default avatarOliver Hader <oliver.hader@typo3.org>
parent bb7ae73e
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