On Thu, Jan 8, 2009 at 7:58 AM, Christopher Mutel <cmu...@gmail.com> wrote:
>
> Hello all-
>
> I recently filed a bug about incorrect SQL generation, and Malcom
> Tredinnick said that the example SQL I provided couldn't be correct,
> because there was an extra LIMIT clause that shouldn't be there. After
> poking around for a bit, I realized that everytime I was executing my
> query in the IPython shell, it was appending a LIMIT 21 to the SQL,
> but this limit clause wasn't being appended if the query was part of a
> regular python process. Both queries are run against SQLite 3.
>
> I uploaded a small test case here that demonstrates this behaviour:
>
> http://www.bitbucket.org/cmutel/extra_limit_21/
>
> It is possible that I have poor python-fu, or is this known behaviour?
> Is it possible that Django is truncating the result list because
> IPython won't show all results anyway?
>
> I have tried searching the Django codebase, and the mailing list, but
> to no avail.

Django [1]generates a LIMIT 21 in the __repr__ method of a queryset,
because it limits such representation to 20 items when it's in the
context of (for example) showing it in a traceback, this was added in
[2]r9202. Maybe you are getting the SQL clause generated by you ROM
query with .query().as_sql() in the interactive Python interpreter and
triggering this?

See if r9717 solves you duplicate column name problem, the problem
in the query isn't caused by that LIMIT part as it isn't sent to the
DB in other 'normal' conditions.

Regards,

-- 
 Ramiro Morales

1. 
http://code.djangoproject.com/browser/django/trunk/django/db/models/query.py#L146
2. http://code.djangoproject.com/changeset/9202

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to