Project

General

Profile

Actions

Bug #103427

closed

DatabaseRecordList::getTables() generates an invalid `COUNT()` query in some cirumstances

Added by Stefan Bürk about 2 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2024-03-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

\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 informations like default orderings and similar has been added.

That is coverd 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 aggretation methods which are not reflected or added
in the counter parts leading to a not so use-full 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 may be adjusted to some extend with server configurations, but
cannot be expected. TYPO3 core must generate valid queries valid
for all database vendor and flavours.

Building up a generic `SELECT` query and reusing it as simple `COUNT`
query requires to avoid the `ORDER BY` and `GROUP BY` and needs to
be removed. Other places throughout the TYPO3 core already does this.

An exception occurred while executing
'
  SELECT COUNT(*) FROM `static_countries`
  WHERE (`static_countries`.`pid` = ?) AND (`static_countries`.`deleted` = 0)
  ORDER BY `cn_short_de` ASC LIMIT 1
' with params [14516]: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with
no GROUP columns is illegal if there is no GROUP BY clause
Actions #1

Updated by Gerrit Code Review about 2 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83523

Actions #2

Updated by Stefan Bürk about 2 months ago

  • Description updated (diff)
Actions #3

Updated by Stefan Bürk about 2 months ago

  • Description updated (diff)
Actions #4

Updated by Gerrit Code Review about 2 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83523

Actions #5

Updated by Gerrit Code Review about 2 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83532

Actions #6

Updated by Gerrit Code Review about 2 months ago

Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83532

Actions #7

Updated by Gerrit Code Review about 2 months ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83524

Actions #8

Updated by Gerrit Code Review about 1 month ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83523

Actions #9

Updated by Gerrit Code Review about 1 month ago

Patch set 3 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83532

Actions #10

Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83524

Actions #11

Updated by Gerrit Code Review about 1 month ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83523

Actions #12

Updated by Gerrit Code Review about 1 month ago

Patch set 4 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83532

Actions #13

Updated by Gerrit Code Review about 1 month ago

Patch set 3 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83524

Actions #14

Updated by Gerrit Code Review about 1 month ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83523

Actions #15

Updated by Gerrit Code Review about 1 month ago

Patch set 5 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83532

Actions #16

Updated by Gerrit Code Review about 1 month ago

Patch set 4 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83524

Actions #17

Updated by Stefan Bürk about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF