Database query count returns incorrect count with distinct
When using the query builder, it's possible that $query->count() == count($query->get()) is false when the distinct method is thrown into the mix.
I wrote a test query that without the distinct returned 6 rows, but with it returned 3. However, the count method on the builder still returned 6 even though the count function correctly said it was 3.
This was with a sqlite database.
What Laravel version please?
ah, sorry, thought I put that. 5.1, tested on a fresh install.
Can you please provide a code sample in gist? I can't seem to reproduce exactly what is happening for you, but I'm assuming that I misunderstood the implementation in my local test.
Could it be somehow connected to #9385 and #9528
Probably. I think we had to revert some of that, and marked this as a nofix.