1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[1.0.X] Fixed .distinct() not working with slicing in Oracle, due to the

row numbers necessarily being distinct.

Backport of r9221 from trunk (since Ian doesn't have commit privileges at the
moment).


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-10-11 00:26:11 +00:00
parent 6cfbd52138
commit 909371e5e5
2 changed files with 17 additions and 35 deletions

View File

@@ -334,6 +334,12 @@ Bug #4464
>>> Item.objects.filter(tags__in=[t1, t2]).filter(tags=t3)
[<Item: two>]
Make sure .distinct() works with slicing (this was broken in Oracle).
>>> Item.objects.filter(tags__in=[t1, t2]).order_by('name')[:3]
[<Item: one>, <Item: one>, <Item: two>]
>>> Item.objects.filter(tags__in=[t1, t2]).distinct().order_by('name')[:3]
[<Item: one>, <Item: two>]
Bug #2080, #3592
>>> Author.objects.filter(item__name='one') | Author.objects.filter(name='a3')
[<Author: a1>, <Author: a3>]