[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3090) Error when executing polymorphic queries with limits

Carl Crowder (JIRA) noreply at atlassian.com
Sun Jul 27 15:28:47 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30730 ] 

Carl Crowder commented on HHH-3090:
-----------------------------------

For what it's worth, this was present in 3.2.2.ga too, as I've just discovered.

> Error when executing polymorphic queries with limits
> ----------------------------------------------------
>
>                 Key: HHH-3090
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3090
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.5
>         Environment: Hibernate 3.2.5, any database
>            Reporter: Jaime Porras
>         Attachments: HQLQueryPlan.diff, test-polymorphic.tar.gz
>
>   Original Estimate: 10 minutes
>  Remaining Estimate: 10 minutes
>
> When a polymorphic search is performed HQLQueryPlan.performList() never return any results because there is a mistake in this code:
> for ( int x = 0; x < size; x++ ) {
>     final Object result = tmp.get( x );
>     if ( distinction.add( result ) ) {
>         continue;
>     }
>     includedCount++;
>     if ( includedCount < first ) {
>         continue;
>     }
>     combinedResults.add( result );
>     if ( max >= 0 && includedCount > max ) {
>         // break the outer loop !!!
>         break translator_loop;
>     }
> }
> The call to distinction.add( result ) returns true when the result is added and false when the result is already in the set. So the if code should be:
>     if ( !distinction.add( result ) ) {
>         continue;
>     }

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