Bug 7178 - <sql:query> maxRows Attribute Seems to be Broken
Summary: <sql:query> maxRows Attribute Seems to be Broken
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: Other All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2002-03-17 01:52 UTC by David Geary
Modified: 2005-03-20 17:06 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description David Geary 2002-03-17 01:52:12 UTC
According to my interpretation of the spec, for the following query:

<sql:query ... startRow='3' maxRows='5'>

You should see rows 3-7 (0-based, 5 rows). Instead, with the RI, I get rows 3
and 4.
Comment 1 Justyna Horwat 2002-03-19 02:00:27 UTC
The maximum rows returned didn't factor in the starting row value when getting
the result set. I limit the result set my the maximum rows and in this case only
the first 5 rows were included and with a starting row of 3 (0 based) you only
saw rows 3 and 4 returned.

The fix involved including the starting row to figure out how many total rows
need to be retrieved. So with a starting row of 3, 8 rows total are retrieved in
the result set and only rows 3-7 (0 based) will be displayed.