Project

General

Profile

Actions

Bug #87655

open

Wrong count by extbase with own QueryBuilder

Added by Stefan Froemken about 5 years ago. Updated over 3 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Extbase
Start date:
2019-02-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

Hello Core-Team,

I have created my own Query with QueryBuilder. As I need a relation to categories I have to prevent duplicates through LEFT JOIN. So I have added GROUP BY to my QueryBuilder and give it to $query->statement($myQueryBuilder).

If I call f:count() in fluid on result it should return 13, but it returns 1. That's because of a problem with COUNT and GROUP BY which results in:

COUNT
1
4
2
3
3

This problem is known in extbase. It is solved with help of $suggestDistinctQuery in Typo3DbQueryParser. But in case of an own QueryBuilder object, this property keeps untouched.

I prefer to check own QueryBuilder objects for an existing GROUP BY and set suggestDistinctQuery to true.

Stefan


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #80464: count() not working correctly in Extbase when using custom statementNew2017-03-27

Actions
Related to TYPO3 Core - Bug #92773: mssql tests fail due to merged patch #87655Closed2020-11-04

Actions
Actions #1

Updated by Gerrit Code Review about 5 years ago

  • Status changed from New to Under Review

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

Actions #2

Updated by Gerrit Code Review about 5 years ago

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

Actions #3

Updated by Gerrit Code Review about 5 years ago

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

Actions #4

Updated by Gerrit Code Review about 5 years ago

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

Actions #5

Updated by Gerrit Code Review about 5 years ago

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

Actions #6

Updated by Gerrit Code Review about 5 years ago

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

Actions #7

Updated by Gerrit Code Review about 5 years ago

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

Actions #8

Updated by Gerrit Code Review about 5 years ago

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

Actions #9

Updated by Gerrit Code Review about 5 years ago

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

Actions #10

Updated by Benni Mack almost 5 years ago

  • Target version changed from next-patchlevel to Candidate for patchlevel
Actions #11

Updated by Gerrit Code Review almost 5 years ago

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

Actions #12

Updated by Gerrit Code Review over 4 years ago

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

Actions #13

Updated by Gerrit Code Review over 4 years ago

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

Actions #14

Updated by Gerrit Code Review about 4 years ago

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

Actions #15

Updated by Gerrit Code Review almost 4 years ago

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

Actions #16

Updated by Gerrit Code Review almost 4 years ago

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

Actions #17

Updated by Gerrit Code Review almost 4 years ago

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

Actions #18

Updated by Mathias Brodala over 3 years ago

  • Related to Bug #80464: count() not working correctly in Extbase when using custom statement added
Actions #19

Updated by Mathias Brodala over 3 years ago

I can confirm this issue with a lazy ObjectStorage property. For now I can work around this by doing a property as array cast in Fluid. This avoids the wrong count query.

Actions #20

Updated by Gerrit Code Review over 3 years ago

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

Actions #21

Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch 10.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/+/66392

Actions #22

Updated by Stefan Froemken over 3 years ago

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

Updated by Anja Leichsenring over 3 years ago

  • Related to Bug #92773: mssql tests fail due to merged patch #87655 added
Actions #24

Updated by Anja Leichsenring over 3 years ago

  • Status changed from Resolved to Accepted

reverted due to incompatibility with mssql

Actions #25

Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review
Actions #26

Updated by Oliver Hader over 3 years ago

  • Status changed from Under Review to Accepted
Actions

Also available in: Atom PDF