Menu

#6 [PATCH] hsqldb's Topic selectByUserByLimit uses wrong order of arguments

Fixed
nobody
None
Medium
Defect
2012-01-22
2011-12-08
Anonymous
No

Originally created by: lohma...@googlemail.com
Originally owned by: andow...@gmail.com

Show topics by user will result in an empty list (at least if there are less than <paginate> topics), since the arguments passed to the SQL-query are in the wrong order.

The SQL statement is

TopicModel.selectByUserByLimit = SELECT LIMIT ? ? [...] AND t.user_id = ? [...}

But it is called via

return super.selectByUserByLimit(count, startFrom, userId);

SELECT LIMIT <skip> <count>
"LIMIT n m
Creates the result set for the SELECT statement first and then discards the first n rows (OFFSET) and returns the first m rows of the remaining result set (LIMIT). Special cases: LIMIT 0 m is equivalent to TOP m or FIRST m in other RDBMS's; LIMIT n 0 discards the first n rows and returns the rest of the result set."

So only in the case when the number of created topics is larger than "count" (the pagination limit), topics would be displayed.

The attached patch fixes the order.

1 Attachments

Related

Wiki: NewFeatures234

Discussion

  • Anonymous

    Anonymous - 2012-01-22

    Originally posted by: andow...@gmail.com

    (No comment was entered for this change.)

    Owner: andow...@gmail.com
    Status: Accepted

     
  • Anonymous

    Anonymous - 2012-01-22

    Originally posted by: andow...@gmail.com

    (No comment was entered for this change.)

    Status: Started

     
  • Anonymous

    Anonymous - 2012-01-22

    Originally posted by: andow...@gmail.com

    (No comment was entered for this change.)

    Status: Fixed

     

Log in to post a comment.