Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong count() for query with offset #300

Open
pandatamara opened this issue Sep 9, 2019 · 3 comments
Open

Wrong count() for query with offset #300

pandatamara opened this issue Sep 9, 2019 · 3 comments

Comments

@pandatamara
Copy link

pandatamara commented Sep 9, 2019

Hi! If i try get count() for my query with offset, i get wrong result 0. i can fix bug:

$tx->select('COUNT(*)', true)->offset(0)->fetchColumn()

If this solution fine - can you add this to lib, plz?

@hapm
Copy link

hapm commented Sep 9, 2019

This is probably related to #199 and should have been fixed with #200 but looks like it isn't. If you have this problem with a group by query, you're fix will not work. See #199 for details.

@cbornhoft
Copy link
Member

@pandatamara can you add the full context of your issue here? The query you're using offset with that's returning 0 please.

@hapm From what I remember of attempts to fix this issue in 2.0, there were major problems with having the query parts stored as strings, and would've required a complete overhaul to fully resolve, so we had to put it on hold.

@hapm
Copy link

hapm commented Sep 10, 2019

@cbornhoft then I guess a fast fix would be to document that count() doesn't work properly on grouped queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants