[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-4764) org.hibernate.test.pagination.PaginationTest.testLimitOffset() fails on oracle and db2 due to
Strong Liu (JIRA)
noreply at atlassian.com
Fri Jan 8 15:23:29 EST 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Strong Liu resolved HHH-4764.
-----------------------------
Resolution: Fixed
> 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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list