Bug 7178

Summary: <sql:query> maxRows Attribute Seems to be Broken
Product: Taglibs Reporter: David Geary <sabreware>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: All   

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.