
Has many IN query gives wrong results
Reported by Robert Sköld | April 30th, 2010 @ 06:38 PM | in 1.1.1
Entry.all( :tags => Tag.first ).size should equal Entry.all.select {|e| e.tags.include? Tag.first }.size
A complete example to illustrate the issue can be found at: https://gist.github.com/bdc83b7c7f8797517f03
Comments and changes to this ticket
-
Dan Kubb (dkubb) May 29th, 2010 @ 01:57 AM
- State changed from new to confirmed
- Assigned user cleared.
I can confirm this behaviour with edge dm-core.
This is due to a problem with how many to many queries are formed when conditions are present. This likely won't be resolved before the 1.0.0 launch, but will be handled quite soon after.
-
Piotr Solnica (solnic) March 24th, 2011 @ 06:29 AM
- Milestone set to 1.1.1
- Milestone order changed from 0 to 0
Now this query just blows up, here's a standalone: https://gist.github.com/884915
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »