Bug #103427
Updated by Stefan Bürk 8 months ago
@\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
<pre>
Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP
columns is illegal if there is no GROUP BY clause
</pre>
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.
<pre>
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
</pre>