]
Strong Liu updated HHH-4764:
----------------------------
Priority: Minor (was: Major)
Fix Version/s: (was: 3.5)
3.5.0-Beta-3
3.3.x
Component/s: (was: core)
testsuite
org.hibernate.test.pagination.PaginationTest.testLimitOffset() fails
on oracle and db2 due to
----------------------------------------------------------------------------------------------
Key: HHH-4764
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4764
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 3.3.2, 3.5.0.Beta-1, 3.5.0-Beta-2
Environment: oracle, db2
Reporter: Strong Liu
Assignee: Strong Liu
Priority: Minor
Fix For: 3.3.x, 3.5.0-Beta-3
the code below, will call Dialect#getLimitString(String query, int offset, int limit),
after a little debug, I found that the limit's value is -2147483550!
*-2147483550 = 99 + Integer.MAX_VALUE*
{code:title=org.hibernate.test.pagination.PaginationTest}
// line 127
result = generateBaseCriteria( session ).setFirstResult( 99 ).setMaxResults(
Integer.MAX_VALUE ).list();
assertEquals( 1, result.size() );
{code}
in Loader.java
{code:title=Loader}
private static int getMaxOrLimit(final RowSelection selection, final Dialect dialect) {
final int firstRow = dialect.convertToFirstRowValue( getFirstRow( selection ) );
final int lastRow = selection.getMaxRows().intValue();
if ( dialect.useMaxForLimit() ) {
return ( lastRow + firstRow ) ;
}
else {
return lastRow;
}
}
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: