This is a fix for #6865
It makes sure that we perform a COUNT(DISTINCT *) when Relation.uniq.count is used. While writing up the patch we noticed that the "count" code path is very different from the other calculations. I wanted to submit a small patch for the problem but we will try to clean up the count code in a second PR.
@rafaelfranca @jonleighton could you take a look? Also what do you think about a backport? Too risky?
Please don't remove this line
Ran into this issue just the other day. Thanks!
`#count` in conjunction with `#uniq` performs distinct count.
@rafaelfranca @carlosantoniodasilva changes are made. Could you check again?
❤️ 💚 💙 💛 💜