You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Craig Russell (JIRA)" <ji...@apache.org> on 2007/09/16 22:03:32 UTC

[jira] Commented: (JDO-529) ChangeQuery - DISTINCT is expected even though it is not specified

    [ https://issues.apache.org/jira/browse/JDO-529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527900 ] 

Craig Russell commented on JDO-529:
-----------------------------------

Right.

The query is
            "SELECT firstname, lastname INTO FullName FROM FullTimeEmployee " +
            "WHERE salary > 1000 & projects.contains(p) & " +
            "p.budget > limit " +
            "VARIABLES Project p PARAMETERS BigDecimal limit " +
            "ORDER BY personid ASCENDING RANGE 0, 5";

Evaluation is done by 14.6.9:
The candidate tuples are 
the cartesian product of the candidate class and all variables used in the result. The result tuples are 
the tuples of the candidate class and all variables used in the result that satisfy the filter. The result 
is the collection of result expressions projected from the result tuples. 

The candidate tuples (the cartesian product of the three full time employees (1, 2, 5) with the three projects (1, 2, 3)) has nine tuples. 

Of these nine, the result tuples are only {(emp1, proj1), (emp2, proj1),  (emp2, proj2), (emp5, proj3)}, that satisfy the condition. 

The projection should have four result objects.


> ChangeQuery - DISTINCT is expected even though it is not specified
> ------------------------------------------------------------------
>
>                 Key: JDO-529
>                 URL: https://issues.apache.org/jira/browse/JDO-529
>             Project: JDO
>          Issue Type: Test
>          Components: tck2
>            Reporter: Ilan Kirsh
>
> Test org.apache.jdo.tck.query.api.ChangeQuery expects 3 result objects:
> List expectedResult = Arrays.asList(new Object[] {
>             new FullName("emp1First", "emp1Last"), 
>             new FullName("emp2First", "emp2Last"),
>             new FullName("emp5First", "emp5Last")});
> But actually there should be 4 result objects:
> List expectedResult = Arrays.asList(new Object[] {
>             new FullName("emp1First", "emp1Last"), 
>             new FullName("emp2First", "emp2Last"),
>             new FullName("emp2First", "emp2Last"),
>             new FullName("emp5First", "emp5Last")});
> because the result is not specified as DISTINCT.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.