#51 Limit keyword does not with orderBy

closed-invalid
None
5
2007-02-28
2006-03-15
Anonymous
No

When performing a select query over a table, the limit
keyword will not be used if orderBy is specified. For
example,

class Test(SQLObject):
total IntCol(notNull=True)

# create SQL connection and stuff
...
res = Test.select(orderBy='total', limit=10)

The results will contain every row from Test, since the
resultant SQL query is similar to
"SELECT id, total FROM test ORDER BY total"
No LIMIT attribute is ever specified. Looking at the
code, this is because limit will only work when used
with the start or end keyword.

Discussion

  • Oleg Broytman

    Oleg Broytman - 2006-03-21
    • status: open --> closed-wont-fix
     
  • Oleg Broytman

    Oleg Broytman - 2006-03-21

    Logged In: YES
    user_id=4799

    The query should be

    res = Test.select(orderBy='total')[:10]

     
  • Oleg Broytman

    Oleg Broytman - 2006-03-21

    Logged In: YES
    user_id=4799

    Please add documentation and tests.

     
  • Oleg Broytman

    Oleg Broytman - 2006-03-21
    • status: closed-wont-fix --> open-invalid
     
  • Oleg Broytman

    Oleg Broytman - 2007-02-28
    • assigned_to: nobody --> phd
    • status: open-invalid --> closed-invalid
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks