[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5699) Integer overflow in setFirstResult() and setMaxResults()

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Oct 29 04:19:48 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38922#action_38922 ] 

Emmanuel Bernard commented on HHH-5699:
---------------------------------------

Do you think you could propose a patch or even better offer a pull request off http://github.com/hibernate/hibernate-core ? That would be awesome. The fix seems quite isolated.

> Integer overflow in setFirstResult() and setMaxResults()
> --------------------------------------------------------
>
>                 Key: HHH-5699
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5699
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.4
>         Environment: Oracle 10g
>            Reporter: Kyrill Alyoshin
>            Priority: Minor
>
> It seems there is an integer overflow bug in pagination APIs... It is very easy to reproduce. If setFirstResult() is greater than 0, and setMaxResults(Integer.MAX_VALUE), the query will return no results. But the moment we set maxResults to (Integer.MAX_VALUE - firstResult), everything works as expected.

-- 
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