Michael Bayer <[EMAIL PROTECTED]> writes:

>> My guess is that the underlying Select object does not take limit
>> into account when offset is 0.
>
> you mean, a limit of zero itself is ignored.  an offset of zero  
> doesn't affect limit.

When _offset is 0 or None, _limit seems to be ignored.  There might be
something else but I see:

 print q[:0] # no limit statement in the SQL
 print q[0:0] # no limit statement in the SQL
 print q[1:1] # limit statement is there

>> You will all agree that this is a bug and that it needs to be fixed.
>> I don't mind digging into the sources to fix it.  Can anyone point me
>> in the right direction?
>
> if the limit is zero Id imagine that no SQL would be issued at all.   
> do you agree ?

That's one way to see it and it would make sense.  However, issuing
the query anyway validates that aside from returning nothing, all the
selected tables are there.  My preference goes for returning an empty
list without emitting SQL.

-- 
Yannick Gingras

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

Reply via email to