]
Strong Liu reassigned HHH-4764:
-------------------------------
Assignee: Strong Liu
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: core
Affects Versions: 3.3.2, 3.5.0.Beta-1, 3.5.0-Beta-2
Environment: oracle, db2
Reporter: Strong Liu
Assignee: Strong Liu
Fix For: 3.5
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: