[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:Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Garvin Hicking <gh@faktor-e.de> Tested-by:
Garvin Hicking <gh@faktor-e.de> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Oliver Hader <oliver.hader@typo3.org> Tested-by:
Oliver Hader <oliver.hader@typo3.org>
Showing
- typo3/sysext/core/Classes/Security/ContentSecurityPolicy/Reporting/ReportRepository.php 118 additions, 27 deletions...rity/ContentSecurityPolicy/Reporting/ReportRepository.php
- typo3/sysext/core/Tests/Functional/Security/ContentSecurityPolicy/Reporting/Fixtures/sys_http_report.csv 6 additions, 0 deletions...tentSecurityPolicy/Reporting/Fixtures/sys_http_report.csv
- typo3/sysext/core/Tests/Functional/Security/ContentSecurityPolicy/Reporting/ReportRepositoryTest.php 38 additions, 0 deletions.../ContentSecurityPolicy/Reporting/ReportRepositoryTest.php
- typo3/sysext/core/ext_tables.sql 3 additions, 1 deletiontypo3/sysext/core/ext_tables.sql
Please register or sign in to comment