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
Upgrading to 1.2.0 breaks total_count for distinct subqueries #1016
Comments
I understand why this presents as a bug but I would contest that using Let's think of I know the example here is contrived, but if I were confronted with .select('COUNT(*)').distinct.group(:id).order('COUNT(*) DESC') then I'd immediately say "lose the Thinking about it, maybe AR should apply |
I think the revert commit of #979 deserves its own release. |
Now that |
Encountered this issue when upgrading from 1.1.1 to 1.2.0, and it seems similar to #1015; likely also related to change #979.
The query below is a little contrived, but it demonstrates the issue and this test passes in 1.1.1 but fails in 1.2.0:
In 1.1.1, the code above issues the following query:
In 1.2.0, it becomes:
Effectively, the
distinct
andselect 1
don't work in combination. Admittedly probably an edge case but I thought it worth reporting nonetheless.Thanks!
The text was updated successfully, but these errors were encountered: